Rumah >pembangunan bahagian belakang >tutorial php > fsockopen顺利后,fwrite失败
fsockopen成功后,fwrite失败
<!-- Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --> $out = "POST $path HTTP/1.0\r\n"; $out .= "Accept: */*\r\n"; $out .= "Accept-Language: zh-cn\r\n"; $out .= "Content-Type: application/x-www-form-urlencoded\r\n"; $out .= "User-Agent: $_SERVER[HTTP_USER_AGENT]\r\n"; $out .= "Host: $host\r\n"; $out .= "Content-Length: ".strlen($post)."\r\n"; $out .= "Connection: Close\r\n"; $out .= "Cache-Control: no-cache\r\n"; $out .= "Cookie: $cookie\r\n\r\n"; $out .= $post; if(!$fp) { return '';//note $errstr : $errno \r\n } else { stream_set_blocking($fp, $block); stream_set_timeout($fp, $timeout); //程序已经跑到这里,但接受POST的文件没执行到。。 @fwrite($fp, $out); @fclose($fp); }