ukblackcat
Technical User
I've been searching the web all day for some form of answer to this but with no joy...
I have a PHP login script that works fine, and uses separate users.dat and log.dat files that are in plain text format (the passwords are md5 encoded). I don't want these to be at the document root level or below, and according to what I've seen written, it would be correct to place them one directory up from the
My web host file structure is as follows:
/home/myname/mainwebsite_cgi -> ../../var/..................../mainwebsite_html -> ../../var/..................../mainwebsite_perl -> ../../var/
where all the mainwebsite directories above are symbolic links to /var/..................................................................................................../perl
..................................................................................................../cgi-bin
I can't create folders under the /var structure at all (probably wise), but can under the /home/myname structure.
The problem that I have is, how does my PHP login script (mysite.com/html/login.php) refer back to the users.dat file (/home/myname/user_data/users.dat)?
In other words, how do I get my Login.php script under the public access to read and write to the users.dat and log.dat under my host home directory structure...
I've tried absolute server referencing (/home/myname/user_data/users.dat), relative referencing (but that just ends up traversing the /var directory due to the symbolic links), and of course, domain referencing is no good as it's outside the document root.
I've seen loads of references to protecting sensitive files by placing them one step back from the document root, but no explanation of how to refer to them.
I hope someone can make some sense of the above...
Thanks.
I have a PHP login script that works fine, and uses separate users.dat and log.dat files that are in plain text format (the passwords are md5 encoded). I don't want these to be at the document root level or below, and according to what I've seen written, it would be correct to place them one directory up from the
My web host file structure is as follows:
/home/myname/mainwebsite_cgi -> ../../var/..................../mainwebsite_html -> ../../var/..................../mainwebsite_perl -> ../../var/
where all the mainwebsite directories above are symbolic links to /var/..................................................................................................../perl
..................................................................................................../cgi-bin
I can't create folders under the /var structure at all (probably wise), but can under the /home/myname structure.
The problem that I have is, how does my PHP login script (mysite.com/html/login.php) refer back to the users.dat file (/home/myname/user_data/users.dat)?
In other words, how do I get my Login.php script under the public access to read and write to the users.dat and log.dat under my host home directory structure...
I've tried absolute server referencing (/home/myname/user_data/users.dat), relative referencing (but that just ends up traversing the /var directory due to the symbolic links), and of course, domain referencing is no good as it's outside the document root.
I've seen loads of references to protecting sensitive files by placing them one step back from the document root, but no explanation of how to refer to them.
I hope someone can make some sense of the above...
Thanks.