Guest User

link.php

a guest
Jul 6th, 2017
246
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. require_once("../libs/proxy.php");
  4. require_once("../libs/config.php");
  5. require_once("../libs/ip.php");
  6.  
  7. $rnd = intval(rand(1000,9999)); //generate random number
  8. $lnk_lnk = "../$db_name/lnk/$userip.xxx"; //link path
  9. $clm_lnk = "../$db_name/claims/$userip.xxx"; //link path
  10. if (file_exists($clm_lnk)) {
  11. $claims = file_get_contents($clm_lnk);
  12. }
  13. else {$claims = "0";}
  14.  
  15.  
  16. try {
  17. $details = substr(file_get_contents("http://ipinfo.io/{$userip}/country"), 0, 2);
  18. if ($details=="US" || $details=="AU" || $details=="NZ" || $details==="GB" || $details==="DE" || $details==="NL" || $details==="FR" || $details==="CA" || $details==="NO" || $details==="SE" || $details==="SA" || $details==="TN")
  19. {
  20.  
  21. $api_url = "https://zap.in/api/zap/?apiKey=YOU_API_KEY_HERE_WITHOUTQUOTES&url=$site_url/links/verifier.php?id=$rnd";
  22. }
  23. else
  24. {
  25.  
  26. $api_url = "https://zap.in/api/zap/?apiKey=YOU_API_KEY_HERE_WITHOUTQUOTES&url=$site_url/links/verifier.php?id=$rnd";
  27. }
  28.  
  29. } catch (Exception $e) {
  30. $api_url = "https://zap.in/api/zap/?apiKey=YOU_API_KEY_HERE_WITHOUTQUOTES&url=$site_url/links/verifier.php?id=$rnd";
  31. }
  32. $get_link = file_get_contents($api_url);
  33.  
  34.  
  35. if (!empty($get_link)) {
  36. $m_lnk = fopen($lnk_lnk, "w"); //open link file
  37. fwrite($m_lnk, $rnd); //store random value
  38. fclose($m_lnk);
  39. header('Location: '.$get_link.'');
  40. } else {
  41. header("Location: ../index.php?lnkmsg=Unknown Error.");
  42. }
  43.  
  44. ?>
RAW Paste Data