php siteye giriş Able bükmek ama giriş sonra hiçbir veri gösterir

0 Cevap php

, HI

Ben php ve curl kullanarak siteye giriş mümkün duyuyorum. CURLOPT_RETURNTRANSFER etkinse ve devre dışı zaman ben ona giriş yaptıktan sonra veri okumaya çalıştığınızda ancak dize gösterir (0) "" it bool (true) gösterir. I yanlış gidiyorum tam olarak nerede ben anlamıyorum ...

herhangi bir yardım gerçekten takdir

iste kodu

$cookie_file_path = "C:\\Apache2\\htdocs\\test.txt";


//$fp = fopen($cookie_file_path,'wb');   
//fclose($fp);

$agent = "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/3.6.0";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"https://kinray.com/redirector1/weblink.jsp");   
curl_setopt($ch, CURLOPT_USERAGENT, $agent);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_fie_path);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file_path);
curl_setopt($ch, CURLOPT_REFERER, "http://www.google.com");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
//Do not print anything now. 
//curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_POSTFIELDS, "custId=XXXXX&passWord=YYYYY");

$html = curl_exec($ch);
var_dump(urlencode($html));

 curl_close();
 $ch1 = curl_init();

   curl_setopt($ch1, CURLOPT_URL,"https://kinray.com/weblink2/search/categories.do?scrollType=&code=&alwaysCustomerNumber=023987");   
   curl_setopt($ch1, CURLOPT_COOKIEFILE, $cookie_fie_path);
   curl_setopt($ch1, CURLOPT_COOKIEJAR, $cookie_file_path);
   curl_setopt($ch1, CURLOPT_RETURNTRANSFER, 1);
   curl_setopt($ch1,CURLOPT_HTTPGET,true);
   //curl_setopt($ch1, CURLOPT_FOLLOWLOCATION, 1);
   //curl_setopt($ch1, CURLOPT_HEADER, 1);
   curl_setopt($ch1, CURLOPT_SSL_VERIFYPEER, 0);
   curl_setopt($ch1, CURLOPT_SSL_VERIFYHOST, 0);
   $html2 = curl_exec($ch1);
   curl_close();
   echo "<hr>";
   var_dump( $html2);

Herhangi bir ipucu nereye ben yanlış gidiyorum?

0 Cevap