Don't like ads? PRO users don't see any ads ;-)
Guest

TargetPay

By: calvinturbo on Jul 4th, 2012  |  syntax: None  |  size: 1.61 KB  |  hits: 16  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.  <?php  
  2. function access()  
  3.     {  
  4.         $ipa = $_SERVER['REMOTE_ADDR'];
  5.         if( isset($_SERVER['HTTP_X_FORWARDED_FOR']) )
  6.         {
  7.         $ipa = $_SERVER['HTTP_X_FORWARDED_FOR'];
  8.         }
  9.  
  10.       $accesscode = $_GET["accesscode"]; // toegangscode berekend op targetpay.com
  11.       $time = (int)$_GET["time"];        // epoch time op targetpay.com
  12.       $ip = $_GET["ip"];                 // CliĆ«nt ip adres op targetpay.com
  13.        
  14.       // Tijd moet groter zijn dan de targetpay tijd
  15.       if( time() < $time )
  16.           {
  17.           die("Lokale tijd is ". (time()-$time) ."sec. vroeger dan op Targetpay.com");
  18.           }
  19.  
  20.       // Remote address moet gelijk zijn als in het betaalscherm
  21.       // Note: Sommige Proxy servers veranderen het IP adres.
  22.       // Mocht u hier problemen mee ondervinden, schakel dan het die() statement uit.
  23.       if( $ip <> $ipa )
  24.           {
  25.           die("Client IP ".$ipa." ongelijk aan ".$ip." op TargetPay.");
  26.           }
  27.       // MYSQL ZOOI HIER OM TE CHECKEN, SELECT IN JE DB OF HUIDIGE ACCESSCODE AL IN DB STAAT
  28.       if (!$accesscode == $accesscodea)
  29.       {
  30.       die("Accesscode ".$accesscode." al gebruikt.");
  31.       }
  32.       // Betalings URL is c*10 minuten geldig
  33.       for ($c=0;$c<=1;$c++)  
  34.         {  
  35.         $t = substr(strftime("%Y%m%d%H%M", time()-($c*600)),0,11);  
  36.         $hash = md5($ip. "e0cd1959dd". $t);  
  37.         if( $hash == $accesscode ) return true;
  38.         }
  39.    
  40.     return false;
  41.     }
  42.  
  43. if (!access())    
  44.     {  
  45.       die ("U heeft niet betaald of de betaling is verlopen.");  
  46.     }  
  47.  
  48.  
  49. // BELCREDITS HIER BIJSCHRIJVEN //
  50. ?>