Membership is FREE – with unlimited access to all features, tools, and discussions. Premium accounts get benefits like banner ads and newsletter exposure. ✅ Signature links are now free for all. Share your own thoughts and experience, accounts may be terminated for violations.

PHP Help

Status
Not open for further replies.
Joined
May 20, 2005
Posts
1,197
Reaction score
6
im told this is simple, but i have no idea where to start
can anyone help (or quickly knock up a quick page/script)

i will have a directory with .pdf files in, all named, doc1.pdf , doc2.pdf, doc3.pdf
(and so on...)

i want a page, with a simple search box, that i can enter "doc1.pdf" into and it will open / show me doc1.pdf.


hopefully that makes sense?
 
really simple stuff:

<?php
if(file_exists('./'.$_POST['filename'])) {
header("Location: /folder/".$_POST['filename']);
}
?>

THat assumes the textfield is called filename

I would probably do some sanity checking to make sure that someone isn't naughty.

Jee
 
thanks. i will check that c0de snippet out :-)


i just want to be able to tell mr smith to go to such and such website, type in his unique code number (the doc filename) and be able to download/view the document (which will be a passworded pdf)

the info is not secret/sensitive.
 
Status
Not open for further replies.
Top Bottom