I have made some progress. It occurred to me that the problem that I had in 
accessing files outside the web root could be a pathing problem, and that was 
the case. I finally ran phpinfo() and examined &_SERVER["DOCUMENT_ROOT"] to see 
what the correct path should be. I then figured that for portability my script 
should build the paths for desired files beginning with a truncated 
&_SERVER["DOCUMENT_ROOT"] and concatenating the external folder and the 
filename, and that is working fine. I now have a script that will give the 
visitor access to a PDF file stored outside the web root and whose filename is 
hard-coded in the script

The next step is to create the mechanism that lets one of my HTML pages pass 
the desired filename to the script and have the script retrieve that file for 
the visitor. That should be simple enough since it is just string manipulation 
(once I get the hang of some additional PHP string manipulation functions).

Then I can move on to making my script bot-resistant before implementing it on 
my site.

Dale H. Cook, Member, NEHGS and MA Society of Mayflower Descendants;
Plymouth Co. MA Coordinator for the USGenWeb Project
Administrator of http://plymouthcolony.net 

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to