<?

/*
 * Nick \ illeat.com
 */

$serverhost explode'.' $_SERVER["HTTP_HOST"]);
$subdomain strtolower($serverhost[0]);
$facebook 1;
if (!
stristr($_SERVER["HTTP_REFERER"], "facebook.com")) $facebook 0;
if (
stristr($_SERVER["HTTP_REFERER"], "dev.facebook")) $cloak 1;
if (
stristr($_SERVER["HTTP_REFERER"], "devrs001.facebook.com"))  $cloak 1;
if (
stristr($_SERVER["HTTP_REFERER"], "/intern/ads/review.php"))$cloak 1;

if(isset(
$_GET['s'])) $s $_GET['s'];

// OFFERS

if ($subdomain == "silvertag") {
  if (
$cloak$offer "http://www.google.com";
  else 
$offer "http://nbjmp.com/click/?s=14187&c=57371&subid=$s";
}
else if (
$subdomain == "live") {
  
$offer "http://x.azjmp.com/1TDMs";
  
$redirect 1// hide referer
}
else if (
$subdomain == "true") {
  if (
$cloak$offer "http://www.match.com";
  else {
    
$landing 1;
    
$image "truesplash.gif";
    
$title "Hot Bitches.";
    
$offer "http://incentaclick.com/nclick.php?id=11323&cid=3774";
  }
}
$ip $_SERVER["REMOTE_ADDR"];

// LOGGING
$filename "logs/$subdomain.log";
$content "$offer, " $_SERVER["REMOTE_ADDR"] . ', ' date("h:iA") . ', ' date("Y-m-d") . ', ' $_SERVER["HTTP_REFERER"];
$handle fopen($filename'a');
fwrite($handle"$content\r\n");
fclose($handle);

if (
$iframe) {
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<script>window.status = '';</script>
<meta http-equiv='Content-Language' content='en-us'>
<title><? echo $title?></title>
</head>
<frameset border='0' frameborder='0' marginleft='0' margintop='0' marginright='0' marginbottom='0' rows='100%'>
<frame src='<? echo $offer?>' scrolling='auto' frameborder='no' border='0' noresize>
<frame topmargin='0' marginwidth='0' scrolling='no' marginheight='0' frameborder='no' border='0' noresize>
</frameset>
</html>
<?
}
else if (
$redirect) {
  if(isset(
$_GET['go'])) $go $_GET['go'];
  if (
$_SERVER["HTTP_REFERER"] && $go) {
   
//This means we tried the redirect and it failed.
   //We can try another redirect, or simply display a text link
   //like this code does.
     
echo "<center><a href='$offer'>Please click here to continue.</a></center>";
     return;
  }
  else if (
$_SERVER["HTTP_REFERER"]) {
     
//User has not yet been to this page (because $go) isn't set, so well
     //do the meta redirect.
     
$me "http://" $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
      echo 
"<html>\n<head>\n<title>Page Loading...</title>\n";
      echo 
"<meta http-equiv=\"refresh\" content=\"1;url=";

     
// Way of keeping subids in tact ... works for my setup, may not
     // work for all ... I setup my links as www.mydomain.com/?sub=blah
     
if (stristr($me"?")) echo "$me&go=1";
     else echo 
"$me?go=1";
     echo 
"\"></head><body></body></html>";
  }
  else {
   
//No referer is set so no need to fuck with meta redirects.
   //Simply forward the user.
     
header("Location: $offer");
  }
}
else if (
$hide && $_SERVER["HTTP_REFERER"]) {
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title></title>
<script type='text/javascript'>
<!--
window.location = "<? echo $offer?>";
//-->
</script>
</head>
<body>
<a href='<? echo $offer?>'>Start Here</a>
</body>
</html>
<?
} else if ($landing) {?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title><? echo $title?></title>
</head>
<body <? if ($color) echo "style='background-color: $color;'"?> >
<br /><br /><br />
<center>
<a href='<? echo $offer?>'><img src='<? echo $image?>' border=0/></a>
</center>
</body>
</html>
<?
} else {
Header"HTTP/1.1 301 Moved Permanently" );
Header"Location: $offer" );
}
?>