The idea is, I need to be constantly online in one web service, but I don’t want to keep the computer turned on all day. To be online it is enough for me to send a simple request to the server once every 3 seconds and it will think that I am online. Actually the question is: is it possible to implement this in PHP?

That is, I enter the launch index.php , and he (the server part, not the client) in an infinite loop sends the webrequest to the specified server. How feasible is it?

  • And how will you constantly send a request if you turn off the computer? - Artem
  • the idea is that the server will never return the page, it will in an infinite loop of php code send a request to another server. It turns out I clicked on the link - thus I ran the script and the server did not answer everything to me, but it works on the page. Or is there some timeout? - koks_rs

2 answers 2

Why not? Quite realizable, set_time_limit(0) and forward, only the server will still need;)

Well, I would recommend to do something so that you can turn off this service, maybe even think about protection from launching these parallel "services", but this is different;)

    For the execution of the script, you definitely need the included machine. Sending a request to other web resources via php is quite possible, this is a matter of three lines of code. Generally, if there are GET requests, then you can even javascript