function Search3 ($id, $year, $term, $ch, $value) {
$data =file_get_contents ("D://value.txt");
curl_setopt ($ch, Curlopt_proxy, ' jackdowosn.gnway.net:81 ');
$curlPost = "xh=k061141026&__viewstate= $value &button2= &ddlkclx= compulsory &xn=2012-2013&xq=1 according to the term of the academic year";
$curlPost = Iconv ("UTF-8", "GBK", $curlPost);
curl_setopt ($ch, Curlopt_useragent, "mozilla/5.0 (Windows; U Windows NT 5.1; En-us; rv:1.8.1.1) gecko/20061204 FIREFOX/4 ");
curl_setopt ($ch, curlopt_followlocation,true);
curl_setopt ($ch, Curlopt_url, "http://211.67.32.51/xscj.aspx");
curl_setopt ($ch, Curlopt_header, 0);
curl_setopt ($ch, Curlopt_returntransfer, 1);
curl_setopt ($ch, Curlopt_post, 1);
curl_setopt ($ch, Curlopt_referer, "http://211.67.32.51/xscj.aspx?xh=K061141026");
curl_setopt ($ch, Curlopt_postfields, $curlPost);
curl_setopt ($ch, Curlopt_cookiefile, $cookiejar); To callback a cookie
$data = curl_exec ($ch);
Curl_close ($ch);
$data = mb_convert_encoding ($data, "Utf-8", "GBK");
/*preg_match_all ('/\\s*\ (.*?) \<\/td\>\s*\ (. *?) \<\/td\>/is ', $data, $matches);
foreach ($matches [1] as $key = $val)
$nav = $nav. " \ n ". $val. "---" . $matches [2] [$key];*/
return $data;
}
When the above program executes to SEARCH3, the other can return the data normally. I asked a senior, and his answer was, "I don't know." I have an impression that we do this problem in the square system, it is possible that the parameter is wrong, it may be the wrong encoding, it may not be set referer this parameter. Please help me to see where the problem is, interested can help me to debug, the proxy server is real available. Here are a few post parameters and header information
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.