PHP Fsockopen/curl How to get the page code problem after the target turn
PHP Code
Failed...
PHP Code
Failed...
Have tried Fsockopen/curl and other methods, get the header and judge the execution, but all
According to the manual, the only difference between the two functions is that thePfsockopen is a continuous connection, while the Fsockopen is not.I wrote a code for a moment:
Copy Code code as follows:
$data =
Is there any way to implement multithreading in PHP? Suppose you are writing a PHP application based on multiple servers, ideally sending requests to multiple servers at the same time instead of one after the other. Can it be achieved? The answer
When php uses fsockopen, the rn and n Terminator in fwrite causes smtp.qq.com to respond incorrectly.
"; Var_dump (stream_get_meta_data ($ sk); fclose ($ sk );
Test Code
The qq server may have changed recently. remember that \ n can be
Recently you need to get music data on someone else's website. The File_get_contents function is used, but the problem of getting failed is always encountered, although the timeout is set according to the example in the manual, but most of the time
PHP fsockopen concurrency
Ask Fsockopen concurrency.
I want to send e-mail I don't know fsockopen this How to concurrent mail
------Solution--------------------
You can do the Ajax loop to send the message, or you can use the following two methods (
Test environment: access a linux server from the Local Machine (windows). (nginx is installed on this server)
The index. php on the server is as follows:Echo 1;
?>
1. Requests using Http1.1 Protocol
Function asyn_sendmail (){
$ Ip = '1970. 168.1.45
According to the manual, the only difference between the two functions is,
PfsockopenIs continuous connection, and
FsockopenNo.
I wrote the following code:
Copy codeThe Code is as follows: $ Data = ", 0, 60D81D509BC00451, 3, FFFFFFFF ";
// Http: //
(Many open service interfaces are available)Compared with the submitted form information, the difference is that the submitted information does not need to be transcoded and directly placed under \ r \ n...Submit page Code As follows:Function
$ Fp = fsockopen ("127.0.0.1", 80); // open the data streamIf (! $ Fp) // if an error occurs{Echo "unable to openn"; // Output Content}Else // if it is enabled successfully{Fwrite ($ fp, "get/http/1.0 rnrn"); // write content to the data
According to the manual, the only difference between the two functions is that
Pfsockopenis a continuous connection, while
FsockopenNo.
I wrote a code for a moment:
Copy Code code as follows:
$data = "1,0,721,73,1,0,0,43290000,0,60D81D509
Get information on the city day of the Sina Weather Report page.
A total of two files:
Tianqi.html: Use the drop-down menu to jump to the web to get weather forecast information, return information to the floating frame;
Please select a
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.