Advertisement
Guest User

Untitled

a guest
May 30th, 2015
262
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.48 KB | None | 0 0
  1. <?
  2.  
  3. /**
  4.  * End-user makes an Ajax request to test.php (server 1), then test.php makes an API call (server 2, hosting sensitive data that cannot be moved to sever 1).
  5.  * In this example, server 2 takes the sleep GET argument and sleep the given number of seconds, then return something
  6.  */
  7. $ch = curl_init();
  8.  
  9. curl_setopt($ch, CURLOPT_URL, 'http://localhost:7331/?sleep='. intval($_GET['sleep']));
  10. curl_setopt($ch, CURLOPT_FRESH_CONNECT, true);
  11.  
  12. curl_exec($ch);
  13. curl_close($ch);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement