user authentication before download

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
suhail_anwar_khan
Forum Newbie
Posts: 11
Joined: Mon Jan 15, 2007 4:22 pm

user authentication before download

Post by suhail_anwar_khan »

hi friends,
please tel me how can i user can be authenticated by user name and password stored in MySQL database before he is allowed to download a file from a webserver, actually i want photos of diffrent users to be stored in diffrent places on web server and no one can download that photos using a direct url, each user should acces only his own photos and hense no download should be allowed without username and password auhentication of the downloader.

i would be greatful if you can provide me with useful links or sample code

thanks
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Place the files outside of a web accessible location and/or place .htaccess files that prevent requesting the files (or possibly an interception.) Use a script to request them.
suhail_anwar_khan
Forum Newbie
Posts: 11
Joined: Mon Jan 15, 2007 4:22 pm

Post by suhail_anwar_khan »

can you please give me a link or a sample code script using which i can download the file
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Sorry, I'm not here to search for you.

We have had threads about this subject area before.
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Post by Kieran Huggins »

search for "image hotlinking" and you'll find a metric tonne of results - usually as easy as dropping a line in your .htaccess file
suhail_anwar_khan
Forum Newbie
Posts: 11
Joined: Mon Jan 15, 2007 4:22 pm

Post by suhail_anwar_khan »

thanks
Post Reply