PHP ile aynı soket üzerinden ve sonrası verileri almak nasıl? Bu kodu vardır:
$fp = fsockopen("ssl://ovi.rdw.nl", 443, $errno, $errstr, 30);
if(!$fp){
echo $errstr;
}else{
$post_data = 'ctl00$cntMaincol$btnZoeken=Zoeken&ctl00$cntMaincol$txtKenteken=83FHVN';
$out = "GET /Default.aspx HTTP/1.0\r\n";
$out .= "Host: ovi.rdw.nl\r\n";
$out .= "Connection: Close\r\n\r\n";
fwrite($fp, $out);
while(!feof($fp)){
$data = fgets($fp);
$view_state = getViewState($data);
if($view_state != ""){
echo $view_state."<br />";
break;
}
}
$post_data = "__VIEWSTATE={$view_state}&".$post_data;
$out = "POST /Default.aspx HTTP/1.0\r\n";
$out .= "Host: ovi.rdw.nl\r\n";
$out .= "Content-type: application/x-www-form-urlencoded\r\n";
$out .= "Content-length: " . strlen($post_data) . "\r\n";
$out .= "Connection: Close\r\n\r\n";
fwrite($fp, $out);
fwrite($fp, $post_data);
while(!feof($fp)){
echo fgets($fp);
}
}
Bu veriler doğru en olsun, ama gönderme Tamam gitmiyor. Ben ne mis mi?