Advertisement
Guest User

Untitled

a guest
Jan 19th, 2020
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. <?php
  2. $api_url = 'http://api.se.com:81/';
  3. $root_dir = '/';
  4.  
  5. $request = $_SERVER['REQUEST_URI'];
  6.  
  7. function send_get($url, $refer = ''){
  8. $ch = curl_init();
  9. curl_setopt($ch, CURLOPT_URL, $url);
  10. curl_setopt($ch, CURLOPT_HEADER, 0);
  11. curl_setopt($ch, CURLOPT_FOLLOWLOCATION,1);
  12. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  13. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  14. curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
  15. curl_setopt($ch, CURLOPT_REFERER, $refer );
  16. curl_setopt($ch, CURLOPT_COOKIE, $key );
  17. curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
  18. curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.2; WOW64; rv:43.0) Gecko/20100101 Firefox/43.0');
  19. curl_setopt($ch, CURLOPT_VERBOSE,1);
  20. return $result = curl_exec($ch);
  21.  
  22. }
  23.  
  24. if(preg_match("/api2/i", $request)
  25. {
  26. include DIR . '/api2/api2.php'
  27. }
  28. else
  29. {
  30.  
  31. $request = str_replace($root_dir, '', $_SERVER['REQUEST_URI']);
  32. echo send_get($api_url.$request, '');
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement