PHP restarts the router to replace the IP address.

Source: Internet
Author: User
PHP restarts the router to replace the IP address program. This article will introduce you to a new version of PHP to restart the vro to replace the IP address program. if you are interested in this, please refer to it. When collecting a large volume of data, the other party is often triggered. This article will introduce you to a new version of PHP to restart the router to replace the IP address program. if you are interested in this, please refer to it. When collecting large volumes of data, the "self-protection" of the other server is often triggered, and access is restricted if the request is too frequent. In this case, the access can be restored after a long period of time (ranging from 10 minutes to dozens of minutes), so that the data collection speed is greatly limited. There are two solutions: 1. bypass the verification code mechanism through image recognition and tell the server: I am not a spider, I am a person. Look, I can understand the verification code. 2. change the IP address and tell the server: I am not Michael Zhang, and I am Mr. Li. Believe it or not, look, my IP address is different from that of John. The first method is a little more difficult and unreliable. when the other server upgrades the verification code one day, it will have to be followed up. there is a lot of trouble, while ISP (China Telecom, China Unicom, and China Mobile) has a lot of IP addresses, A new IP address is assigned for each network connection. Therefore, Method 2 is better. Take my TP-LINK router as an example, find "network parameters"> "WAN port settings", you can see the "automatic connection" settings and "disconnected" button. Each time you click the "disconnected" button, you can call the ISP again and change the IP address. However, the collection of large volumes of data takes a long time, and it is impossible for someone to keep it. it is best to restart the PHP code once it is found to be restricted, this will return to the topic of this article: "restart the router through PHP function to replace IP address" open the debugging mode of chrome browser, then click the "disconnected" button to view the "Network" Network request, the actual execution address is: "http: // 192.168.0.1/userRpm/PPPoECfgRpm.htm? Wantype = 2 & acc = 65541234 & psw = Hello123World & VnetPap = 0 & linktype = 2 & Disconnect = % B6 % CF + % CF % DF "and then simulate the request for this address, after testing, you can change the IP address (you can see the current IP address through http://api.akcms.com/myip.php ). The following is simple: PHP uses the Curl component to implement the request process. I encapsulate a function resetip. the specific code is as follows:
 
 
The code is as follows:
      
You need to modify the highlighted area according to your own situation. some vro addresses are 192.168.1.1, and the restart addresses are also different, but they are similar and you need to modify them yourself.

Bytes. When collecting large volumes of data, it often triggers the other party...

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.