|
-
November 13th, 2004, 05:08 PM
#1
Http referer Check Script
i hope if u can help me doing this
i have found what i want whitch is A referer check Script for Protecting downloads
here is the Script :
PHP Code:
<?php
///////////////////////////////////////////////
// //
// Download Protector v 1.1 //
// ----------------------------------------- //
// by Graeme ([email protected]) //
// [url]http://www.phpscriptcenter.com[/url] //
// //////////////////////////////
// PHP Script CENTER offers no warranties on this script. //
// The owner/licensee of the script is solely responsible for any //
// problems caused by installation of the script or use of the script //
// //
// All copyright notices regarding Download Protector, must remain //
// intact on the scripts and in the HTML for the scripts. //
// //
// (c) Copyright 2001 PHP Script CENTER //
// //
// For more info on Download Protector, //
// see [url]http://www.phpscriptcenter.com/downloadprotector.php[/url] //
// //
///////////////////////////////////////////////////////////////////////////
$ADMIN[defaulturl] = "http://phpscriptcenter.com";
$okaysites = array("http://phpscriptcenter.com","http://www.phpscriptcenter.com");
$ADMIN[url_1] = "http://www.phpscriptcenter.com/download.php3?product=";
$ADMIN[url_2] = "http://downloads.com";
$ADMIN[url_3] = "http://downloads.com/new";
//////////////////////////////////////////////////////
$reffer = $HTTP_REFERER;
if($reffer) {
$yes = 0;
while(list($domain, $subarray) = each($okaysites)) {
if (ereg("$reffer",$subarray)) {
$yes = 1;
}
}
$theu = "url"."_"."$site";
if ($ADMIN[$theu] AND $yes == 1) {
header("Location: $ADMIN[$theu]/$file");
} else {
header("Location: $ADMIN[defaulturl]");
}
} else {
header("Location: $ADMIN[defaulturl]");
}
?>
The Script Check if the referer is one of the arrays which is :
$okaysites = array("http://phpscriptcenter.com","http://www.phpscriptcenter.com");
but fairly that doesn't work. the script didn't work with me Until i make the referer check for a specific Webpage for example :
http://phpscriptcentre.com/url.html << if the link was Pressed from there it will Pass else it will redirect to the Chosen site
it didn't work also for a Forum topic i put the referer to check with the thread id but it didn't work
..............................................
all what i want how to make the Script pass allllll links opened from my domain www.domain.com
or i have another idea instead of checking the Exact referer can anybody Edit the code to check if the referer contain a (Word) which is my Domain name like www.mysite.com
so the script check if the referer contain mysite if yes Continue <<<
thx in advance
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|