Posted: Wed Sep 11, 2002 4:11 pm
Thanks! I can work on rest of it 
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
<?
$domain = "www.site.net";
//$domain = array("site.net","www.site.net","site.site.net");
$refr=getenv("HTTP_REFERER");
list($remove,$stuff)=split('//',$refr,2);
list($home,$stuff)=split('/',$stuff,2);
if($home!=$domain) {
header("Location: http://www.site.net/error.shtml");
} else {
$file = $pafiledb_sql->query($db, "SELECT * FROM $dbїprefix]_files WHERE file_id = '$id'", 1);
$time = time();
$update = $pafiledb_sql->query($db, "UPDATE $dbїprefix]_files SET file_dls=file_dls+1, file_last=$time WHERE file_id = '$id'", 0);
header("Location: $fileїfile_dlurl]");
}
?>Code: Select all
if(!in_array($refr,$domain)) {
error
} else {
pass
}Code: Select all
if(!eregi("domain.com",$refr)) {
error
} else {
pass
}as Dusty pointed out maybe you should consider checking something else in case you inadvertently prevent people from accessing the content from your own site.'HTTP_REFERER'
The address of the page (if any) which referred the user agent to the current page. This is set by the user agent. Not all user agents will set this, and some provide the ability to modify HTTP_REFERER as a feature. In short, it cannot really be trusted.
That means you not trusting them, cos bandwidth thieves are part of usercodewarrior wrote:I trust the users all the time ... but its the freaking bandwidth thieves that drive me nuts!!!!!!!!!!
Ok thanksEricS wrote:If you running on a *nix server, you can modify the .htaccess file to keep out bandwidth thieves. Don't remember the exact modification needed but a quick search should reveal the answer.
Hope this helps.
Takuma wrote:That means you not trusting them, cos bandwidth thieves are part of usercodewarrior wrote:I trust the users all the time ... but its the freaking bandwidth thieves that drive me nuts!!!!!!!!!!