I have a site and I only want people who are on my site to access certain links so I created a dl.php file and put this in it:
<?php
if (stristr($HTTP_REFERER, $HTTP_HOST)) {
Header ( "Content-Type: application/octet-stream");
Header ( "Content-Length: ".filesize("downloads/$dl"));
Header( "Content-Disposition: attachment; filename=$dl");
readfile("downloads/$dl");
} else {
header("Location:index.php");
exit;
}
?>
Some people are reporting that after clicking on a link on my site they are getting sent to the index page and I can't figure out why or reproduce the problem... Any ideas?
Thanks,
Andrew
PS >> You can view it in actionhere.