$post_data ='[email protected]&Password=123456';$curl = curl_init();curl_setopt($curl, CURLOPT_URL,"http://www.12345.com/login.html");curl_setopt($curl, CURLOPT_HEADER,1);curl_setopt($curl, CURLOPT_REFERER,"Googlebot/2.1 (+http://www.google.com/bot.html)");curl_setopt($curl, CURLOPT_USERAGENT,"Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20100101 Firefox/11.0");curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);curl_setopt($curl, CURLOPT_SSL_VERIFYHOST,2);curl_setopt($curl, CURLOPT_ENCODING,"");curl_setopt($curl, CURLOPT_COOKIEJAR,"dosya.txt");curl_setopt($curl, CURLOPT_COOKIEFILE,"dosya.txt");curl_setopt($curl, CURLOPT_VERBOSE,1);curl_setopt($curl, CURLOPT_POST,true);curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);curl_setopt($curl, CURLOPT_FOLLOWLOCATION,true);curl_setopt($curl, CURLOPT_RETURNTRANSFER,true);
$veri = curl_exec($curl);echo $veri;curl_close($curl);
Ben bu kodu aspx sitesine girmek için kullanıyorum ama aşağıdaki hatayı veriyor
<!-- Web.Config Configuration File --><configuration><system.web><customErrorsmode="RemoteOnly"defaultRedirect="mycustompage.htm"/></system.web></configuration>
Zaman
2013-10-19 21:47:19Php php cURL login to Asp.net Site