$form = send_request('http://www.petrolesport.ru/services_info.php'); preg_match_all("/var (bid|sid) = '(.{32})'/Ui", $form, $matches); $sid = $matches[2][0]; $bid = $matches[2][1]; sleep(3); $status = send_request('http://www.petrolesport.ru/GetContInfo.php?q=HMCU9104979&sid=' . $sid . '&bid=' . $bid); var_dump($status); function send_request($url) { $headers = array( "Host: www.petrolesport.ru", "User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:2.0.1) Gecko/20100101 Firefox/4.0.1", "Accept: */*", "Accept-Language: en-US,en;q=0.8,ru;q=0.6", "Accept-Encoding: gzip, deflate,sdch", "Connection: keep-alive", "Referer: http://www.petrolesport.ru/services_info.php" ); $ch = curl_init($url); curl_setopt_array($ch, array( CURLOPT_HEADER => 1, CURLOPT_HTTPHEADER => $headers, CURLOPT_RETURNTRANSFER => true, CURLOPT_VERBOSE => true, )); $verbose = fopen('php://temp', 'rw+'); curl_setopt($ch, CURLOPT_STDERR, $verbose); $output = curl_exec($ch); rewind($verbose); $verboseLog = stream_get_contents($verbose); echo "Verbose information:\n<pre>", htmlspecialchars($verboseLog), "</pre>\n"; curl_close($ch); return $output; } |