Need some cloaking help here - Expert Needed

pasenseoso

Power Member
Joined
Aug 19, 2011
Messages
765
Reaction score
141
I got some cloaking code and it works perfectly with firefox. But, it does not work on google chrome. Can somebody help me fix this code??? I'm doing double meta refresh.

first php file :
Code:
<?php
echo "<meta http-equiv=\"refresh\" content=\"0;url=offer.php\">";
?>


second php file (saved as offer.php) :

Code:
<?php
$sites = array_map("trim", file("offer.txt"));
$redirect = $sites[array_rand($sites)];
$referer = $_SERVER['HTTP_REFERER']; if($referer == "")
echo "<meta http-equiv=\"refresh\"content=\"0;url=http://".$redirect."\">"; 
else
{
echo "<meta http-equiv=\"refresh\" content=\"0;url=http://www.google.com\">";  
}
?>



and got a text file with the links to get redirected randomly.

Here's what it do :

1. redirect to the links in the offer.txt file (random)

2. it does work on firefox

3. DOES NOT work in Google Chrome.

Does anyone have a solution for this???


-drey
 
Certainly your problem is caused by a bug concerning the referer
$_SERVER['HTTP_REFERER'].

There is a well known issue concerning this bug in Chrome, see issue id=1935 on code google. {srry cannot post link}​

Check the value of $referer if its the same under all browers.
If not, you could try something like this:

Code:
<?php
[B]$_SESSION["referer"] = $_SERVER['HTTP_REFERER'];[/B]
echo "<meta http-equiv=\"refresh\" content=\"0;url=offer.php\">";?>

Code:
<?php
$sites = array_map("trim", file("offer.txt"));
$redirect = $sites[array_rand($sites)];
[B]$referer = $_SESSION["referer"];$_SESSION["referer"] = "";[/B]  
if($referer == "")
echo "<meta http-equiv=\"refresh\"content=\"0;url=hxxp...".$redirect."\">"; 
else{
echo "<meta http-equiv=\"refresh\" content=\"0;url=LINKTOGOOGLE">";  }
?>
 
Back
Top