Application Example of PHP socket (fsockopen) function
Using the Fsockopen function, the first thing to do is to open the allow_url_open=on in php.ini;
Fsockopen is the encapsulation of the socket client code, which encapsulates the socket_create ()
Fsockopen function can be used, first of all, to open the php.ini in the Allow_url_open=on;
Fsockopen is the encapsulation of the socket client code, which encapsulates the socket_create,socket_connect.
Server-side code: server.php
Copy Code
Fsockopen spoofs the post and get methods. If you are looking for PHP processing code that spoofs the post and get methods, this is good.
// Fsocket simulate post submission$ Purl = "http: // localhost/netphp/test2.php? UU = rrrrrrrrrrrr ";Print_r
How to solve the fsockopen function?
This is an example of remote file size I found online.
If the domain name is normal, the file size will be returned if the file exists,
If the domain name is normal and the file does not exist, false is
Fsockopen function can be used, first of all to open the php.ini in the Allow_url_open=on;
Fsockopen is the encapsulation of the socket client code, which encapsulates the socket_create,socket_connect.
Server-side code: server.php
Copy CodeThe code
I'm a little upset today. I 'd like to write an article about the data of php fsockopen post. We can imitate it and send it to the other server. If you need it, check it out.
The Code is as follows:
Copy code
POST/Target
To use the fsockopen function, you must first enable allow_url_open = on in php. ini;
Fsockopen is the encapsulation of socket Client code. This function encapsulates socket_create and socket_connect.
Server code: server. php
Copy codeThe Code is
When the website was launched, modoer and ucenter could not communicate. I had to spend almost two days. at first, I thought that my configuration was faulty. after the platform was transplanted, I could not communicate. I modified the configuration
This paper uses the Fsockopen () function to write a simple-function port scanner. The port number of this instance is fixed, through an array of traversal, using the Fsockopen () function connection, if the connection is successful, the port is
Using fsockopen to get Baidu's search page I use php functions fsockopen and fwrite, fgets and other commands can directly get the content of the http://www.baidu.com home page, but can not get the http://www.baidu.com/s? Wd = Speaker & pn = 20
For Port 43 connected to the fsockopen function, I am now working on a program for querying the whois information of the domain name. now some domain names can be queried, such as com and net domain names. Some types cannot be found. for example, if
To use the fsockopen function, you must first enable allow_url_open = on in php. ini;Fsockopen is the encapsulation of socket Client code. This function encapsulates socket_create and socket_connect.Server code: server. phpCopy codeThe Code is as
CausePhp script source code:Copy codeThe Code is as follows:$ Fp = fsockopen ("udp: // $ ip", $ rand, $ errno, $ errstr, 5 );If ($ fp ){Fwrite ($ fp, $ out );Fclose ($ fp ); The fsockopen function in the php script sends a large number of packets to
How to solve the Fsockopen function, error
Get File sizefunction remote_filesize ($url _file) {if (!remote_file_exists ($url _file)) return false;$HEADINF = Get_headers ($url _file,1);return $headInf [' content-length '];}Determine if a file
In the previous three examples, there is a piece of code: while (! feof ($fp)) { // read File/Data //$content. = Fgets ($fp, +); $line = Fread ($fp, 4096); $line = fputs ($fp 2,fgets ($fp, +));}The PHP feof () function is used to detect
This article is an example of how PHP implements automatic submission of forms based on fsockopen and curl. Share to everyone for your reference, specific as follows:
Fsockopen and curl All can do PHP automatic submission Form
1. Fsockopen Method:
So the question is whether the coding problem, or file permissions, or is not a function does not support the problem, after the investigation found that the L1 host does not support Fsockopen, in the file uc_client/client.php Uc_fopen in the
Use PHP to simulate post and get transfer data to another Web page or site
$arr =array (' user ' => ' test ', ' Password ' => ');
Sock_get ($post _url, $arr);
Sock_post ($post _url, $arr);
Fsocket simulate get Commit function sock_get
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.