RE: [PHP] TimeOut

From: Date: Sat, 05 Aug 2000 23:57:01 +0000
Subject: RE: [PHP] TimeOut
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-10283@lists.php.net to get a copy of this message
I have tried the following script on WinNT5, Apache/1.3.13-dev, PHP Version 4.0.1pl2 and OpenBSD2.7 Apache/1.3.12, PHP Version 4.0.1pl2 (mod_php4) push.php; ----------8<-------snip-----------8<------start <?php header("HTTP/1.0 200 OK"); header("Content-type: multipart/x-mixed-replace;boundary=ThisRandomString"); print("\n"); print( "--ThisRandomString\n"); print("Content-type: text/html\n"); print("\n"); print( "First update at "); echo date("H:i:s"); print("\n\n"); print( "--ThisRandomString\n"); flush(); sleep(5); print("Content-type: text/html\n"); print("\n"); print( "Second update at "); echo date("H:i:s"); print("\n\n"); print("--ThisRandomString--\n"); ?> ----------8<-------snip-----------8<------end On NT with the header("HTTP/1.0 200 OK"); statement I get an Apache error message; [Sun Aug 06 09:02:47 2000] [error] [client 192.168.0.60] malformed header from script. Bad header=HTTP/1.0 200 OK: f:/program files /novato/maildirector/php.exe I do not get this error on OpenBSD. I then removed the header("HTTP/1.0 200 OK"); statement and now NT and OpenBSD give the following output to the browser(IE5.0); (after a 5 second pause) ----------8<-------snip-----------8<------start --ThisRandomString Content-type: text/html First update at 18:22:47 --ThisRandomString Content-type: text/html Second update at 18:22:52 --ThisRandomString ----------8<-------snip-----------8<------end And the following output to the browser(Netscape 4.6); (after a 5 second pause) ----------8<-------snip-----------8<------start Second update at 18:23:19 ----------8<-------snip-----------8<------end ie I never see the first update at ... part of the output as I would expect. I have also tried it with; header("Content-type: multipart/mixed;boundary=ThisRandomString"); but it make no difference, the behaviour is identical. IE5 does not seem to understand multipart. The multipart mime boundary does not seem to be working properly in Netscape4.6. Any clues as to what is wrong? Thanks in advance Andrew Braund > -----Original Message----- > From: Christensen, BruceX R [mailto:brucex.r.christensen@intel.com] > Sent: Saturday, 5 August 2000 8:48 AM > To: PHP mailing list (E-mail) > Subject: RE: [PHP] TimeOut > > > Actually, that is how server push works. The connection > between the browser > and the client isn't severed, and the server keeps "pushing" more > information. See > http://home.netscape.com/assist/net_sites/pushpull.html > for details. > > As for keeping the connection from timing out, see > http://www.php.net/manual/function.set-time-limit.php. > > --Bruce > > Bruce Christensen > Intel Corporation > brucex.r.christensen@intel.com > > > -----Original Message----- > From: dave@musiccity.net [mailto:dave@musiccity.net] > Sent: Friday, August 04, 2000 8:49 AM > To: Rob Iten; php-general@lists.php.net > Subject: Re: [PHP] TimeOut > > > Unfortunately, that's not how http works. You could > possibly do it using a > Java applet or some kind of server push program, but I'd > recommend setting a > meta refresh for something like 20 seconds or whatever you think is > appropriate. The page will be refreshed, but the user won't > have to do it > himself. > > ----- Original Message ----- > From: "Rob Iten" <robiten@bellsouth.net> > To: <php-general@lists.php.net> > Sent: Friday, August 04, 2000 10:19 AM > Subject: [PHP] TimeOut > > > > Howdy. > > Is there any sort of issue associated with setting a > script so it doesn't > > time out? I need users to be able to retrieve new > information from a > server > > program without using refreshes. I am thinking of doing > it by making it > so > > the script never times out and waits until new > information comes into the > > server program so it can display it. > > > > Thanks, > > Rob

« previous php.general (#10283) next »