Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?
- /**
- * 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).
- * In this example, server 2 takes the sleep GET argument and sleep the given number of seconds, then return something
- */
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, 'http://localhost:7331/?sleep='. intval($_GET['sleep']));
- curl_setopt($ch, CURLOPT_FRESH_CONNECT, true);
- curl_exec($ch);
- curl_close($ch);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement