Skip to content

Instantly share code, notes, and snippets.

@valinurovam
Last active August 29, 2015 14:14
Show Gist options
  • Save valinurovam/6ca1e7a8ae716a90c68c to your computer and use it in GitHub Desktop.
Save valinurovam/6ca1e7a8ae716a90c68c to your computer and use it in GitHub Desktop.
<?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