Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $t1 = 'https://alice.sni.velox.ch';
- $t2 = 'https://carol.sni.velox.ch';
- function build_handle($url)
- {
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_ENCODING, "");
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($ch, CURLOPT_POST, true);
- curl_setopt($ch, CURLOPT_URL, $url);
- curl_setopt($ch, CURLOPT_HEADER, true);
- curl_setopt($ch, CURLOPT_FORBID_REUSE, true);
- curl_setopt($ch, CURLOPT_FRESH_CONNECT, true);
- return $ch;
- }
- $alice = build_handle($t1);
- $response = curl_exec($alice);
- curl_close($alice);
- echo "\n------------- Alice: -----------\n";
- echo "$t1\n";
- echo substr($response, 0, strpos($response, "\r\n\r\n"));
- $carol = build_handle($t2);
- $response = curl_exec($carol);
- curl_close($carol);
- echo "\n------------- Carol: -----------\n";
- echo "$t2\n";
- echo substr($response, 0, strpos($response, "\r\n\r\n"));
- $carol = build_handle($t2);
- $response = curl_exec($carol);
- curl_close($carol);
- echo "\n------------- Carol 2: -----------\n";
- echo "$t2\n";
- echo substr($response, 0, strpos($response, "\r\n\r\n"));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement