Enjoy unlimited access to all forum features for FREE! Optional upgrade available for extra perks.

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.

The Rule #1

Do not insult any other member. Be polite and do business. Thank you!

Featured Services

Sedo - it.com Premiums

IT.com

Premium Members

AucDom
UKBackorder
Be a Squirrel
Acorn Domains Merch
MariaBuy Marketplace

New Threads

Domain Forum Friends

Other domain-related communities we can recommend.

Our Mods' Businesses

Perfect
Service
Laskos
*the exceptional businesses of our esteemed moderators
Top Bottom