The file can be located anywhere as long as you use the full URL to point to it. However I prefer to keep all my php scripts in the 'www' folder as this is the root for mobile site server.
To prevent issues with the main Kurogo file setup I created a folder called 'custom_scripts' (but you can call it anything as long as it is not a folder name already used by Kurogo, for example you should not call it 'map' as this will interfere with the map module).
Then just store your scripts in there, the URL will begin with the root URL of your site with "/custom_scripts/[script_name]" appended. For example:
Michael