Hi Chardelle and thanks
My files do similar things to yours. My issue is a security issue. I want the files to be accessed only by people who have logged into moodle. I do not want the files to be available to the general public.
The solution that was pointed to by Bill Burgos which is to include some moodle code to check whether someone is logged in may be a good idea. It does mean though that I would have to hack my php files (which are produced by Codecharge) but it seems pretty easy. I would also have to put them into my site rather than outside.
I guess I just keep hoping that there are some automated systems which will let me do what I want...