| 发表于:2007-01-13 14:00:08 楼主 |
主要是伪装http头的问题,郁闷的,我用xmlhttp.setrequestheader伪装没调试成功 function httppostconnect($host,$path,$fieldarray=array()) { $port=80; if(sizeof($fieldarray) > 0) { $body = _encodefields( $fieldarray ); }else{ $body = " "; } $len = strlen( $body ); $request=($body ? "post " : "get "). " $path http/1.0\r\n ". "host: $host\r\n ". "accept: */*\r\n ". "accept-language: en-us,zh-cn;q=0.5\r\n ". ($body ? "content-type: application/x-www-form-urlencoded\r\n " : " "). "proxy-connection: keep-alive\r\n ". ($len ? "content-length: $len\r\n " : " "). "\r\n ". ($body ? "$body " : " "); $fp = fsockopen( "$host ", $port, $errno, $errdesc, 30 ); if(!$fp) return false; fputs($fp,$request); while(trim(fgets($fp,1024)) != " "); return $fp; } |
|
|
|
|