Redirect prob

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
User avatar
phpcoder
Forum Contributor
Posts: 158
Joined: Sat Nov 02, 2002 1:18 pm
Location: Manchester, UK

Redirect prob

Post by phpcoder »

I have a page that redirct user to downlod file but download dsnt start automatically .
header("Redirect: $_GET['file']);
I have given link i.e if download dsnt start auto...... click here .. but i want file download to start automatically .Plz tell me how 2 solve this prob .
thanks
Deemo
Forum Contributor
Posts: 418
Joined: Sun Jan 18, 2004 11:48 am
Location: Washington DC

Post by Deemo »

header("Location: $_GET['file']") not Redirect
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Correction on Deemo's: header("Location: {$_GET['file']}") ... however, I'd suggest using [php_man]readfile[/php_man]() the download script.. (so people have a harder time getting the actual location of the file. Which helps your counter stay accurate by preventing hot-linking)
Deemo
Forum Contributor
Posts: 418
Joined: Sun Jan 18, 2004 11:48 am
Location: Washington DC

Post by Deemo »

thanks for the correction feyd ;)
Post Reply