Re: [PHP] Delaying Printed Output

2001-03-25 Thread Greg Scott

 Have you looked into javascript/java?

This client has worked up a Power Point slide presentation that he wants 
me to duplicate on the web.  I had a PHP solution that was working fine, 
but then he decided to jazz up his Power Point presentation some.  The 
adding a single line of text at time didn't seem to complicated so I was 
going to see if I could find a PHP solution to it that would work with 
all browsers.  But now he's decided that he wants motion involved with 
it too, so I guess I'll start learning a little more about FLASH.  I did 
discover I have an Adobe program I have can use to create FLASH files so 
I guess I'll try that route and just warn him that he may be eliminating 
some web visitors this way (actually I'll probably keep the old PHP 
slide show and give them an option). 

Thanks everyone for your input into this.
Greg


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Delaying Printed Output

2001-03-25 Thread Andrew Braund

This topic comes up from time to time...

Some previous information, if you get any further please post it to the list.


A while ago I saw a web page explaining a system (written in Perl I
think) that was used to show a presentation to a number of different
sites simultaneously (and synchronised). A presenter was at the main
site and the browsers at 4 other remote sites would display the same
page the presenter was viewing on his web browser as he went to various
sites. I think it worked using multipart Content-type.
Unfortunately I have lost the URL to the explanation of how it was
done.

On Saturday, 5 August 2000 8:48 AM Mr Bruce Christensen posted the following links 
explaining browser push;
http://home.netscape.com/assist/net_sites/pushpull.html
and;
As for keeping the connection from timing out, see
http://www.php.net/manual/function.set-time-limit.php.


I have experimented with this but didn't get too far. I posted the following to the 
PHP list but didn't get any reply.



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/allcnet/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 With Netscape 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 makes 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.


Regards
Andrew Braund


 -Original Message-
 From: Greg Scott [mailto:[EMAIL PROTECTED]]
 Sent: Sunday, 25 March 2001 04:49
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] Delaying Printed Output
 
 
  You might try using flush() after the prints.
  
 I tried that too, but at least in Netscape 6, it still waits until 
 everything is done before displaying.  I think Jack must be correct that 
 this isn't possible for browser display.
 
 Thanks,
 Greg


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Delaying Printed Output

2001-03-24 Thread Greg Scott

Is it possible using PHP to print a single line of text to a browser, 
have a second or two delay and then print the next line, etc. etc.?

Greg



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Delaying Printed Output

2001-03-24 Thread KPortsmout

In a message dated 24/03/2001 14:47:03 GMT Standard Time, [EMAIL PROTECTED] 
writes:

 Is it possible using PHP to print a single line of text to a browser, 
 have a second or two delay and then print the next line, etc. etc.?
 
 Greg 

Hi,

You can use the following commands:

sleep(seconds);
usleep(microseconds);

HTH
Ade

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Delaying Printed Output

2001-03-24 Thread Philip Olson

to go along with this, check out :

  Output Control Functions :
  http://www.php.net/manual/en/ref.outcontrol.php

and some interesting ones in the Misc section :

  Miscellaneous Functions  :
  http://www.php.net/manual/en/ref.misc.php

links to a few tutorials are listed in ocf section.  speaking of ocf, 
the Oregon Country Fair is coming up ... July 13-15 2001.  the fresh
squeezed orange juice is SO good!  :-)

regards,

philip

On Sat, 24 Mar 2001 [EMAIL PROTECTED] wrote:

 In a message dated 24/03/2001 14:47:03 GMT Standard Time, [EMAIL PROTECTED] 
 writes:
 
  Is it possible using PHP to print a single line of text to a browser, 
  have a second or two delay and then print the next line, etc. etc.?
  
  Greg 
 
 Hi,
 
 You can use the following commands:
 
 sleep(seconds);
 usleep(microseconds);
 
 HTH
 Ade
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Delaying Printed Output

2001-03-24 Thread Greg Scott

 You can use the following commands:
 
 sleep(seconds);
 usleep(microseconds);

I've tried those 2 functions, in an example like this:

PRINT "Thisbr";
SLEEP(2) ;
PRINT "Is abr";
SLEEP(2);
PRINT "TEST";

But the way it works in the browser is to wait for a total of 4 seconds 
and then it displays all the text at once, not one line at a time - 
which is what I'm after.

Greg


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Delaying Printed Output

2001-03-24 Thread Jack Dempsey

I may be wrong about this, but I'm pretty sure that, being server side, PHP
sends the HTML to the browser all at once...also, the browser needs a static
HTML page to load up...it can't take a line and output as it goes...maybe
i'm wrong, but i thought that was basically how it works, so you couldn't do
the sleep thing you wanted...
anyone else?

jack

-Original Message-
From: Greg Scott [mailto:[EMAIL PROTECTED]]
Sent: Saturday, March 24, 2001 1:42 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP] Delaying Printed Output


 You can use the following commands:

 sleep(seconds);
 usleep(microseconds);

I've tried those 2 functions, in an example like this:

PRINT "Thisbr";
SLEEP(2) ;
PRINT "Is abr";
SLEEP(2);
PRINT "TEST";

But the way it works in the browser is to wait for a total of 4 seconds
and then it displays all the text at once, not one line at a time -
which is what I'm after.

Greg


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Delaying Printed Output

2001-03-24 Thread CC Zona

In article [EMAIL PROTECTED],
 [EMAIL PROTECTED] (Greg Scott) wrote:

  sleep(seconds);
  usleep(microseconds);
 
 I've tried those 2 functions, in an example like this:
 
 PRINT "Thisbr";
 SLEEP(2) ;
 PRINT "Is abr";
 SLEEP(2);
 PRINT "TEST";
 
 But the way it works in the browser is to wait for a total of 4 seconds 
 and then it displays all the text at once, not one line at a time - 
 which is what I'm after.

You might try using flush() after the prints.

-- 
CC

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Delaying Printed Output

2001-03-24 Thread Greg Scott

 You might try using flush() after the prints.
 
I tried that too, but at least in Netscape 6, it still waits until 
everything is done before displaying.  I think Jack must be correct that 
this isn't possible for browser display.

Thanks,
Greg


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Delaying Printed Output

2001-03-24 Thread Kelly Corkill


Speaking off the top of my head, seems like a combination of html meta
refresh and a variable that increments based on HTTP REFERRER=PHP_SELF could
provide the effect you're looking for. Certainly you could meta refresh to
new pages in sequence. Or of course just use an animated gif if static text.
Have you looked into javascript/java?

I doubt that you can do it solely within php as it parses once and delivers
html. The connection betwixt the server and client is transaction and the
client would have to initiate the call to update, unless the update was
imbedded within and staged at the client. 

On Sat, 24 Mar 2001, CC Zona wrote:

 Date: Sat, 24 Mar 2001 11:06:02 -0800
 From: CC Zona [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] Delaying Printed Output
 
 In article [EMAIL PROTECTED],
  [EMAIL PROTECTED] (Greg Scott) wrote:
 
   sleep(seconds);
   usleep(microseconds);
  
  I've tried those 2 functions, in an example like this:
  
  PRINT "Thisbr";
  SLEEP(2) ;
  PRINT "Is abr";
  SLEEP(2);
  PRINT "TEST";
  
  But the way it works in the browser is to wait for a total of 4 seconds 
  and then it displays all the text at once, not one line at a time - 
  which is what I'm after.
 
 You might try using flush() after the prints.
 
 -- 
 CC
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 

Kelly

303-444-1671
Boulder, Colorado



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Delaying Printed Output

2001-03-24 Thread Jeff Oien

I don't know if this will be helpful but you can look at this
JavaScript code:
http://www.webdesigns1.f2s.com/js_typing_text.php
---
Jeff Oien
PHP start here
http://www.webdesigns1.com/php/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Delaying Printed Output

2001-03-24 Thread CC Zona

In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Greg Scott) wrote:

  You might try using flush() after the prints.
  
 I tried that too, but at least in Netscape 6, it still waits until 
 everything is done before displaying.  I think Jack must be correct that 
 this isn't possible for browser display.

By any chance is this within a table? Not sure what v.6 expects, but at 
least in earlier versions Netscape refused to show table content until it 
encountered the closing /table tag.  With the end result that flush() 
appears not to be working, when actually PHP is doing its job fine but NN 
is being a bit of a PITA.

-- 
CC

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]