I am programming an AJAX web application, but I am encountering a potential problem regarding timeouts. Some browsers (notably Safari) will “wait” only 1 minute for a request to be sent back from PHP. Here is a bit of my code:
[code=php]$initquery = “select * from MyTable…”; // a MySQL query
do{
sleep(1);
$result = mysql_query($initquery);
$result = mysql_fetch_assoc($result);
}while($result[“continue”]==”no”);
The code works fine. The problem is, if [FONT=”Courier New”]$result[“continue”][/FONT] does not change to “yes” within a minute (this is done by other scripts), the browser will stop waiting and issue a timeout error. Is there a way to make the browser wait longer for a response? I was thinking that this could be done with some kind of header that sets timeout at five minutes or something (like [FONT=”Courier New”]header(‘Cache-Control: no-cache, must-revalidate’);[/FONT] makes the browser not cache the page). Is this possible? Thanks in advance.
[COLOR=”White”].