• Welcome to AcornDomains.co.uk, a friendly community for UK domain investors, developers and anyone interested in domain names.

    Whether you're looking to buy or sell domains, learn more about the UK domain market, get feedback on your names, or simply chat with other domainers, you're in the right place. AcornDomains has been bringing together people from across the UK domain industry for many years, from complete beginners to experienced investors.

    Have a look around, join the discussions and, if you haven't already, create a free account and introduce yourself.

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