(been away for a bit)
Thanks for your suggestions, it's given me things to think about.
At the moment the web processes (and php) run as 'www-data'.
Can I set up php files that belong to 'www-data' that can be run by 'www-data' but not read by anyone else?
I'm sure it's a chown thing but I'm not sure anymore.
Then what would be nice is to have a script that was only readable by 'www-data' that users would include that supplied a username and password depending on where the script was running say by looking at
$_SERVER["REQUEST_URI"]
might give ->
/~me/myscript.php
and so dish out the username and password for "me"
I get an error when I try to change the contents of this variable by directly assigning it to some other string directly so people couldn't change it to fool the script into thinking the script was someone elses...