title: php fake referrer multi redirect
body: <p>I'm using this code to hide my traffic source, it works great but it has only 1 value, how to edit code to support multi value?</p>
  
  <p>E.g.:</p>
  
  <p>index.php?mn=1 => affiliateurl-1.com</p>
  
  <p>index.php?mn=2 => affiliateurl-2.com</p>
  
  <p>index.php?mn=3 => affiliateurl-3.com</p>
  
  <p>index.php?mn=4 => affiliateurl-4.com</p>
  
  <pre><code>&lt;?php
  
  $magic_number = 1; // Any number you choose except ZERO!
  
  $affiliate_url = 'http://www.affiliateurl.com/';
  
  $PHP_SELF = preg_replace( "/index.php/", "", $_SERVER['PHP_SELF'] );
  
  if (isset($_GET['mn']) &amp;&amp; $_GET['mn']==$magic_number){      
  
  echo '&lt;html&gt;&lt;head&gt;&lt;META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW"&gt;&lt;/head&gt;&lt;body&gt;&lt;form action="' . 'http://'.$_SERVER['HTTP_HOST'].$PHP_SELF. '" method="post" id="form1"&gt;
  
  &lt;input type="hidden"  name="mn" value="' . $magic_number . '" /&gt;&lt;/form&gt;
  
  &lt;script language="JavaScript"&gt; 
  document.getElementById(\'form1\').submit();&lt;/script&gt;&lt;/body&gt;&lt;/html&gt;';
      return true; 
      exit();
  }
  
  if ($_POST['mn']==$magic_number){       
  
  echo '&lt;html&gt;&lt;head&gt;&lt;META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW"&gt;&lt;/head&gt;&lt;body&gt;&lt;form action="' . 'http://'.$_SERVER['HTTP_HOST'].$PHP_SELF. '" method="post" id="form1"&gt;
  
  &lt;input type="hidden"  name="mn" value="' . $magic_number . $magic_number . '" /&gt;&lt;/form&gt;
  
  &lt;script language="JavaScript"&gt; 
  document.getElementById(\'form1\').submit();&lt;/script&gt;&lt;/body&gt;&lt;/html&gt;';
      return true; 
      exit();
  }   
  
  $dom = preg_replace( "/^www\./", "", $_SERVER[ 'HTTP_HOST' ] ) ;
  $ref= $_SERVER['HTTP_REFERER'];
  
  if (((strpos($ref, $dom)!=FALSE) || (trim($ref)=="" ) ) &amp;&amp; (!isset($_GET['mn']))  &amp;&amp; ($_POST['mn']==$magic_number.$magic_number)){
      header( 'Location: ' . $affiliate_url);
      exit();
  }
  
  ?&gt;
  </code></pre>