After fsockopen is successful, fwrite fails. PHPcode $ out = & quot; POST $ pathHTTP/1.0 \ r \ n & quot; $ out. = & quot; Accept: */* \ r \ n & quot; $ out. = & quot; A fsockopen succeeds, fwrite fails
PHP code
$ 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"; $ ou T. = $ post; if (! $ Fp) {return ''; // note $ errstr: $ errno \ r \ n} else {stream_set_blocking ($ fp, $ block); stream_set_timeout ($ fp, $ timeout); // The program has run here, but the file that accepts the POST is not executed .. @ Fwrite ($ fp, $ out); @ fclose ($ fp );}
The local test is acceptable, and it will not work when it reaches the server...
------ Solution --------------------
Why not? You provide too little information to judge.
------ Solution --------------------
How can this happen? check the permission first, isn't it read-only?
------ Solution --------------------
$ Fp fsockopen statement is not displayed. paste the complete code.
------ Solution --------------------
The server has no write permission.