Fakat sonraki sayfaya ulaştığımda bu hatayı alıyorum.
"Hata oluştu.
Bu hatayla ile ilgili gerekli bilgi geliştiricilere yollandı. Ayrıca karşılaştığınız hatayı destek sayfamıza bildirebilirsiniz."
Bu hata galiba cookie ile alakalı diye tahmin ediyorum...
Örnek içerik
<?php
$url = "xxx/Login.aspx";//giriş sayfası
$urlto = "xxx/LoncaList.aspx";//gösterim sayfası
$kullanici ='xxx[at]mynet.com';$sifre='1234';
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_HEADER, FALSE);
curl_setopt($curl, CURLOPT_NOBODY, FALSE);
curl_setopt($curl, CURLOPT_REFERER,"");
curl_setopt($curl, CURLOPT_USERAGENT,$_SERVER['HTTP_USER_AGENT']);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$gelenveri=curl_exec($curl);
$reg = "/value=\"(.*?)\"/i";preg_match_all($reg, $gelenveri, $eslesen); $VIEW=str_replace('"','',$eslesen[0][3]);$VIEWSTATE=str_replace('value=','',$VIEW);$EVENT=str_replace('"','',$eslesen[0][6]);$EVENTVALIDATION=str_replace('value=','',$EVENT);
$fields = array('__LASTFOCUS' => '','__EVENTTARGET' => '','__EVENTARGUMENT' => '','__VIEWSTATE' => $VIEWSTATE,'__SCROLLPOSITIONX' => '', '__SCROLLPOSITIONY' => '', '__EVENTVALIDATION' => $EVENTVALIDATION,'ctl00$ContentPlaceHolder1$txtUserName' => $kullanici,'ctl00$ContentPlaceHolder1$txtPasword' => $sifre,'ctl00$ContentPlaceHolder1$btnxxxLogin' => '');
curl_close($curl);
//asp post değerlerini aldık.
$curl= curl_init();
curl_setopt($curl, CURLOPT_URL,$url);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $fields);
curl_setopt($curl, CURLOPT_REFERER,$url);
curl_setopt($curl, CURLOPT_USERAGENT,$_SERVER['HTTP_USER_AGENT']);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_COOKIEJAR, "cookies.txt"); // Cookie management.
curl_setopt($curl, CURLOPT_COOKIEFILE, "cookies.txt");
curl_setopt($curl, CURLOPT_COOKIESESSION, TRUE);
$giris=curl_exec($curl);
$reg = "/value(.*?).com/i";preg_match_all($reg, $giris, $sonuc);if(!empty($sonuc[0][0])){echo "Giriş Başarılı (".$sonuc[0][0].")";}else{echo "Giriş Hatası";}
//kullanıcı girişi yaptık
$site=curl_setopt($curl, CURLOPT_URL,$urlto);
$goster=curl_exec($curl);
echo $goster;
//sayfamızı göstermek istedik
?>ÇıktısıGiriş Başarılı(value="xxx[at]mynet.com) Hata oluştu. Bu hatayla ile ilgili gerekli bilgi geliştiricilere yollandı. Ayrıca karşılaştığınız hatayı destek sayfamıza bildirebilirsiniz.Test adresi test.php