Page 1 of 1
how would i go about the following
Posted: Fri Oct 25, 2002 7:41 am
by nabberuk
i need to protect my downloads from leechers, any ideas on the best way to do this in php?
thanks in advance
Posted: Fri Oct 25, 2002 8:57 am
by volka
define leechers (or what kind of leechers you want to ban)
Posted: Fri Oct 25, 2002 10:09 am
by qads
i think he wants to hide his download url volka....
if so then make a page with
Code: Select all
<?php
if(IsSet($file))
{
header("location: path/to/download/folder/$file");
}
else
{
echo "what do you want?";
}
?>
then link to it like
Code: Select all
<a href="page.php?file=filename.ext">Download</a>
um...is this the best way to do it?
Posted: Fri Oct 25, 2002 1:23 pm
by volka
header('Location ....'); will lead to a 302 redirect (at least under apache) and the browser (at least IE

) recognizes this and will store the new url.
once again: I'm not getting tired of pointing to this article
Prevent Hotlinking with Apache Server Rewrite Module
Posted: Fri Oct 25, 2002 4:24 pm
by qads
well yes...but not everyone owns a server.
Posted: Fri Oct 25, 2002 10:11 pm
by hob_goblin
.htaccess is the way to go.
thanks
Posted: Sat Oct 26, 2002 8:09 am
by nabberuk
thanks for all your answer, thi has helped me a great deal
thanks
one more thing
Posted: Sat Oct 26, 2002 8:11 am
by nabberuk
with the apache module thingy, will i have to write a htaccess file for each file i want to protect.
thanks
Posted: Sat Oct 26, 2002 8:48 am
by volka
since there can be only one .htaccess per directory the answer must be: no
http://httpd.apache.org/docs/