I have a cable modem that has a habit of dying on me, normally either overnight or whenever I leave the house (such as right now).
I know the modem has a HTTP-based configuration page, and I know it uses the POST method to send the reboot command.
What I wish to do is write a simple script that pings a web site (eg yahoo) every 5 minutes, and if the web site cannot be found do a HTTP POST to the cable modem with the reboot command.
How can I send a HTTP POST in PHP?
Please understand that I don't mean "How can I have a web page process HTTP POST in php?"
Hope someone out there can help..
I have looked and found how to do the same thing via telnet, however Windows XP's telnet command does not let you pipe input to it:
How do we pass content to the HTTP server via standard input? Here's how to do it with telnet (If you don't use the same fname and lname values shown here, remember to adjust the Content-Length figure so that the posttest.cgi script knows how much to read in from the standard input):
POST /xml/crud/posttest.cgi HTTP/1.1 Host: snee.com Content-Length: 21 fname=Barry&lname=WomThe above is an example of what I would need to send.