PHP/CGI help
How do I access a file using local file paths instead of the URL
path from a PHP script? I'm trying to allow only trusted (logged on) users to access certain restricted files so the files must not be directly accessible from a URL. eg. I have the following directory layout... ~/public_html ~/private_files public_html is mapped by the web server to my ~$USER directory. How can a script from inside public_html access the private_files directory. |
You can use fopen, readfile, ....
Look here for working with local files: http://www.php.net/manual/en/ref.filesystem.php |
why don't u write a script asking for authorization, then u include "authorization.php"; in the private files. so nothing else will be displayed to visitors not logged in.
if u're working with apache there might be a chance of excluding unknown vistors using the .htaccess file. see apache manual for that. cheers, jens |
All times are GMT -5. The time now is 02:23 AM. |