By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,949 Members | 1,824 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,949 IT Pros & Developers. It's quick & easy.

How to display web page continuosly?

P: n/a
I have a script that takes collects info from various websites to
compile a report. However whenever I run it, my web browser waits for
the script to finish ( 1 minute ) before displaying the report. But my
script is outputting data every few seconds . So is there a way to
make my browser display the web page every few seconds and update
automatically as more data comes?

Mar 2 '07 #1
Share this Question
Share on Google+
9 Replies


P: n/a
On Fri, 02 Mar 2007 06:59:43 +0100, <ve*****@yahoo.comwrote:
I have a script that takes collects info from various websites to
compile a report. However whenever I run it, my web browser waits for
the script to finish ( 1 minute ) before displaying the report. But my
script is outputting data every few seconds . So is there a way to
make my browser display the web page every few seconds and update
automatically as more data comes?
Yup, there is. It's called AJAX, and it's javascript method. You can use
it to have a web page waiting for input from another script (in your case
the php script).
--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Mar 2 '07 #2

P: n/a
..oO(OmegaJunior)
>On Fri, 02 Mar 2007 06:59:43 +0100, <ve*****@yahoo.comwrote:
>I have a script that takes collects info from various websites to
compile a report. However whenever I run it, my web browser waits for
the script to finish ( 1 minute ) before displaying the report. But my
script is outputting data every few seconds . So is there a way to
make my browser display the web page every few seconds and update
automatically as more data comes?

Yup, there is. It's called AJAX, and it's javascript method. You can use
it to have a web page waiting for input from another script (in your case
the php script).
Two years ago the answer probably would have been as simple as

| Try flush() to force the script output being sent and don't put the
| entire page into a big table, as some browsers are not able to render
| it incrementally.

Today all folks cry for AJAX immediately, even for something as simple
as a status report ...

Micha
Mar 2 '07 #3

P: n/a
Michael Fesser wrote:
Today all folks cry for AJAX immediately, even for something as simple
as a status report ...
AJAX will solve all problems. If it fails to, try Mr. Clean. Yeah he's
got an earing, but man is he tough on dirt and grime.

Mar 2 '07 #4

P: n/a
ve*****@yahoo.com wrote:
I have a script that takes collects info from various websites to
compile a report. However whenever I run it, my web browser waits for
the script to finish ( 1 minute ) before displaying the report. But my
script is outputting data every few seconds . So is there a way to
make my browser display the web page every few seconds and update
automatically as more data comes?
Two things can be happening here:

1. PHP and Apache are caching the data. Calling flush() should send it
to the browser

2. The browser itself is caching before displaying. Some browsers will
do this if they can't display things right away (i.e. a table without
columns and widths defined). Simplifying your HTML could help here.

I'd use AJAX as a last resort. It's way overkill for something like this.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Mar 2 '07 #5

P: n/a
flush() is good, but AJAX is modern and cool and everybody wants modern and
cool webs :)

Michael Fesser wrote:
.oO(OmegaJunior)
>>On Fri, 02 Mar 2007 06:59:43 +0100, <ve*****@yahoo.comwrote:
>>I have a script that takes collects info from various websites to
compile a report. However whenever I run it, my web browser waits for
the script to finish ( 1 minute ) before displaying the report. But my
script is outputting data every few seconds . So is there a way to
make my browser display the web page every few seconds and update
automatically as more data comes?

Yup, there is. It's called AJAX, and it's javascript method. You can use
it to have a web page waiting for input from another script (in your case
the php script).

Two years ago the answer probably would have been as simple as

| Try flush() to force the script output being sent and don't put the
| entire page into a big table, as some browsers are not able to render
| it incrementally.

Today all folks cry for AJAX immediately, even for something as simple
as a status report ...

Micha
Mar 2 '07 #6

P: n/a
..oO(Gootes)
>flush() is good, but AJAX is modern and cool and everybody wants modern and
cool webs :)
modern + cool = unreliable ;)

AJAX is optional, server-side stuff works always.

Micha
Mar 2 '07 #7

P: n/a
<ve*****@yahoo.compíse v diskusním príspevku
news:11**********************@s48g2000cws.googlegr oups.com...
>I have a script that takes collects info from various websites to
compile a report. However whenever I run it, my web browser waits for
the script to finish ( 1 minute ) before displaying the report. But my
script is outputting data every few seconds . So is there a way to
make my browser display the web page every few seconds and update
automatically as more data comes?
Use flush() and some other tricks.
1) do not use <tabledesign or if you must, use a short tables. Many
browsers do not dispaly anything until get the </tabletag.
2) Many browsers wait for unspecified number of bytes before dispaly part of
page content. To avoid this you can send say 1024 spaces - char(32) - after
each data you need to display immediately. Browser reduce these 1024 spaces
to 1 only but must show content.
--

Petr Vileta, Czech republic
(My server rejects all messages from Yahoo and Hotmail. Send me your mail
from another non-spammer site please.)
Mar 3 '07 #8

P: n/a
thanks for the replies, flush worked perfectly, wish I had known about
that before as AJAX is too complicated for something so simple.

Mar 3 '07 #9

P: n/a
On Fri, 02 Mar 2007 10:06:08 +0100, Michael Fesser <ne*****@gmx.dewrote:
.oO(OmegaJunior)
>On Fri, 02 Mar 2007 06:59:43 +0100, <ve*****@yahoo.comwrote:
>>I have a script that takes collects info from various websites to
compile a report. However whenever I run it, my web browser waits for
the script to finish ( 1 minute ) before displaying the report. But my
script is outputting data every few seconds . So is there a way to
make my browser display the web page every few seconds and update
automatically as more data comes?

Yup, there is. It's called AJAX, and it's javascript method. You can use
it to have a web page waiting for input from another script (in your
case
the php script).

Two years ago the answer probably would have been as simple as

| Try flush() to force the script output being sent and don't put the
| entire page into a big table, as some browsers are not able to render
| it incrementally.

Today all folks cry for AJAX immediately, even for something as simple
as a status report ...

Micha
Hey, veg_all asked for any solution, not the easiest one. Had I known
about flush() I probably would've opted that too.

Thank you for sharing!

--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Mar 3 '07 #10

This discussion thread is closed

Replies have been disabled for this discussion.