View Single Post
Old 03-05-2011, 10:14 PM  
HarryMuff
Confirmed User
 
HarryMuff's Avatar
 
Join Date: Dec 2005
Posts: 271
Quote:
Originally Posted by SmokeyTheBear View Post
save as secret.php
Code:
<?php
$guy = $_SERVER["HTTP_REFERER"];
$num = rand(1, 100);
if ($guy == ""){
?>
var visitor = "google bot";
<?php
} else {
?>
var visitor = "not a bot";
<?php
if($num < 80){
?>
top.location.href="http://redirect.com";
<?php
}
}
?>
call in head of page like <script src=http://yoursite.com/secret.php></script>
What is the point of declaring "visitor" in js then never using it?
Also, if a blank "HTTP_REFERER" means it's the google bot then why would you go and use javascript to redirect when you could do it in PHP?
HarryMuff is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote