Last active
August 29, 2015 14:14
-
-
Save valinurovam/6ca1e7a8ae716a90c68c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Created by PhpStorm. | |
* User: Alexander | |
* Date: 27.01.15 | |
* Time: 0:54 | |
*/ | |
$post_data = 'next=okay'; | |
$url = 'http://delphir.com/protocol.html'; | |
$page = "/protocol.html"; | |
$headers = array( | |
"POST ".$page." HTTP/123.4", | |
"Content-Type: application/x-www-form-urlencoded", | |
"Content-length: ".strlen($post_data), | |
"Cookie: allow_any_protocol=true", | |
); | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL,$url); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); | |
curl_setopt($ch, CURLOPT_TIMEOUT, 60); | |
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); | |
curl_setopt($ch, CURLOPT_POST, 1); | |
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data); | |
$data = curl_exec($ch); | |
echo $data; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment