Hello, I trying to create code what will hide content if its for example being viewed by proxy... But for unknown reason proxy still can view page, also hotlink works to. Any ideas how to fix it? Here is code: $validprefixes = array ( "page.com", "www.page.com" ) ; function isreferrerokay ( $referrer, $validprefixes ) { $validreferrer = 0 ; $authreferrer = current( $validprefixes ); while ($authreferrer) { if (eregi( "^https?://$authreferrer/", $referrer )) { $validreferrer = 1 ; break ; } $authreferrer = next( $validprefixes ); } return $validreferrer ; } $referrer = getenv("HTTP_REFERER" ); if (isset($_SERVER['QUERY_STRING'])) { if (empty($referrer) || isreferrerokay( $referrer, $validprefixes )) { //all content goes here }} PHP: Thanks.
Hope this helps: http://www.slightlyshadyseo.com/index.php/controlling-your-referer-and-hiding-your-traffic-sources/
Thanks, but my code does same thing like this one: if(stristr($_SERVER[’HTTP_REFERER’],â€myBlackhatdomain.comâ€)!==FALSE) //we have a BH redirect { //Output the Javascript in Step 5 } else { //Output pretty whitehat content that will satisfy an affiliate program } PHP: except "//Output the Javascript in Step 5". I cant understand why my code doesn't work, because then i tried echo $_SERVER[’HTTP_REFERER’]; it returned me my page then i was on my page.