Hi all, We currently have a system which updates a number of websites by calling URLs on those sites. This is done like this: fopen("http://www.myurl.com/", "r"); Code (markup): The problem is that PHP waits until it gets a response from each site before moving on. This can cause delays at busy times. Is there any way to carry out the same URL call without waiting for the response? TIA
Either: Using system/exec to fork a background copy of your PHP script Or: Use www.php.net/fsockopen and simply close the socket before reading any output (better option). Jay
you can fork the process and come back to it later, i believe. check _http://uk3.php.net/manual/en/ref.pcntl.php although I have not done this. depends on your needs - if you rely on data being parsed from the html of the remote page to complete the building of your page, then you just have to wait. best practice is - for a busy site to a site with / via a poor network connection - crontab a script to go and fetch contents every 5 or 10 minutes and write it to a local DB, then just get your script to read from that DB. Of course, it will only work if you don't deal with any critical data that needs to be updated to the minute or second... another thing i tend to do for similar problems is ajax it (which is in effect going to fork it) then apply the results to the page dom as needed.