There is a problem with parsing the aspx page. I'm trying to get information about the delivery of the goods, the problem is that the page is displayed, but the information about the delivery of the goods is not displayed. I can not understand what the problem is. It seems that cookies are normally given (session id, etc.), the order number is indicated.

The php code is below:

$ch = curl_init(); curl_setopt($ch, CURLOPT_COOKIEJAR, "/tmp/cookieFileName"); curl_setopt($ch, CURLOPT_URL,"http://79.174.68.35/Client/Tracking.aspx"); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, "ctl00 $ContentPlaceHolderMain$TextBoxNumbers=00000000316505"); ob_start(); curl_exec ($ch); ob_end_clean(); curl_close ($ch); unset($ch); $ch = curl_init(); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_COOKIEFILE, "/tmp/cookieFileName"); curl_setopt($ch, CURLOPT_URL,"http://79.174.68.35/Client/Tracking.aspx"); echo $buf2 = curl_exec ($ch); curl_close ($ch); 

I tried as below, but then swears that the MAC check failed:

The php code is below:

 $url = "http://79.174.68.35/Client/Tracking.aspx"; $ckfile = tempnam("/tmp", "CURLCOOKIE"); $useragent = 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/533.2 (KHTML, like Gecko) Chrome/5.0.342.3 Safari/533.2'; $f = fopen('log.txt', 'w'); // file to write request header for debug purpose /** Get __VIEWSTATE & __EVENTVALIDATION */ $ch = curl_init($url); curl_setopt($ch, CURLOPT_COOKIEJAR, $ckfile); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_USERAGENT, $useragent); $html = curl_exec($ch); curl_close($ch); preg_match('~<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="(.*?)" />~', $html, $viewstate); preg_match('~<input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="(.*?)" />~', $html, $eventValidation); $viewstate = $viewstate[1]; $eventValidation = $eventValidation[1]; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, false); curl_setopt($ch, CURLOPT_COOKIEJAR, $ckfile); curl_setopt($ch, CURLOPT_COOKIEFILE, $ckfile); curl_setopt($ch, CURLOPT_HEADER, FALSE); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_REFERER, $url); curl_setopt($ch, CURLOPT_VERBOSE, 1); curl_setopt($ch, CURLOPT_STDERR, $f); curl_setopt($ch, CURLOPT_USERAGENT, $useragent); // Collecting all POST fields $postfields = array(); $postfields['__LASTFOCUS']=''; $postfields['__EVENTTARGET'] = ''; $postfields['__EVENTARGUMENT'] = ''; $postfields['__VIEWSTATE'] = $viewstate; $postfields['__EVENTVALIDATION'] = $eventValidation; $postfields['ctl00$ctl00$ContentPlaceHolderMain$ButtonTracking'] = 'Проверить'; $postfields['ctl00$ctl00$ContentPlaceHolderMain$TextBoxNumbers'] = '00000000316505'; curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields); $ret = curl_exec($ch); print $ret; 
  • curl_setopt($ch, CURLOPT_POSTFIELDS, "ctl00 $ContentPlaceHolderMain$TextBoxNumbers=00000000316505"); The name of the POST parameter is formed dynamically from two variables ?? There is no error? - jekaby
  • slightly corrected the question to show how I tried again - RomanM

0