473,765 Members | 1,967 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Solution to display on a web page each second a new line wanted

Hallo

I'm looking for a solution to display on a web page each second a new
line.
Unfortunately does the following solution not work with the Internet
Explorer:

http://test.seekware.ch/test/flush-withtable.php

PHP code:
<html>
<head>
<?php
header("cache-control: no-cache");
header("pragma: no-cache");
?>
</head>

<body>
<?php
echo "<table border = '1'>";

for ($counter = 0; $counter <= 5; $counter++) {
echo "<tr><td>" . $counter . "<br></td></tr>";

ob_flush();
flush();
sleep(1);
}

echo "</table>";
?>
</body>
</html>
Even if I do it without a table it does not work with the Internet
Explorer:

http://test.seekware.ch/test/flush-notable.php

PHP code:
<html>
<head>
<?php
header("cache-control: no-cache");
header("pragma: no-cache");
?>
</head>

<body>
<?php
for ($counter = 0; $counter <= 5; $counter++) {
echo $counter . "<br>";

ob_flush();
flush();
sleep(1);
}
?>
</body>
</html>
Does someone know a solution which works also with the Internet
Explorer?

Regards
Stefan

PS: Both solutions work with Mozilla and Opera.
Aug 3 '08 #1
4 1754
On 3 aug, 03:12, Stefan Mueller <seekw...@yahoo .comwrote:
Hallo

I'm looking for a solution to display on a web page each second a new
line.
There are two typical solutions for this:
1) You use Javascript to retrieve a new line every second, AJAX style.
2) You output a page which reloads itself every second and pass a new
line to it each time.
* * * * * for ($counter = 0; $counter <= 5; $counter++) {
* * * * * * echo $counter . *"<br>";

* * * * * * ob_flush();
* * * * * * flush();
* * * * * * sleep(1);
* * * * * }
Interesting approach. What you do is send the first part of the page
to the client, wait a second, send another line, etc. The call to
sleep(1) makes the server wait before outputting anything else. So the
webbrowser does not receive the whole page until all lines have been
printed. The browser may wait until it has received the whole page
before rendering it (as IE does).
PS: Both solutions work with Mozilla and Opera.
This is because they try to render the page while it has not been
fully retrieved yet, but you can not really depend on this.
Aug 3 '08 #2
Stefan Mueller wrote:
Hallo

I'm looking for a solution to display on a web page each second a new
line.
Unfortunately does the following solution not work with the Internet
Explorer:

http://test.seekware.ch/test/flush-withtable.php

PHP code:
<html>
<head>
<?php
header("cache-control: no-cache");
header("pragma: no-cache");
?>
</head>

<body>
<?php
echo "<table border = '1'>";

for ($counter = 0; $counter <= 5; $counter++) {
echo "<tr><td>" . $counter . "<br></td></tr>";

ob_flush();
flush();
sleep(1);
}

echo "</table>";
?>
</body>
</html>
Even if I do it without a table it does not work with the Internet
Explorer:

http://test.seekware.ch/test/flush-notable.php

PHP code:
<html>
<head>
<?php
header("cache-control: no-cache");
header("pragma: no-cache");
?>
</head>

<body>
<?php
for ($counter = 0; $counter <= 5; $counter++) {
echo $counter . "<br>";

ob_flush();
flush();
sleep(1);
}
?>
</body>
</html>
Does someone know a solution which works also with the Internet
Explorer?

Regards
Stefan

PS: Both solutions work with Mozilla and Opera.
Yes, it might work in some browsers and not others. What should happen
in this case is undefined and browsers are left to their own devices on
how to implement it.

As Sjoerd indicated, AJAX can do it. Flash and Java applets can also do it.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===

Aug 3 '08 #3
On Sat, 2 Aug 2008 18:12:38 -0700 (PDT), in comp.lang.php Stefan
Mueller <se******@yahoo .com>
<67************ *************** *******@k37g200 0hsf.googlegrou ps.com>
wrote:
>| Hallo
|
| I'm looking for a solution to display on a web page each second a new
| line.
| Unfortunately does the following solution not work with the Internet
| Explorer:
|
| http://test.seekware.ch/test/flush-withtable.php
|
| PHP code:
| <html>
| <head>
| <?php
| header("cache-control: no-cache");
| header("pragma: no-cache");
| ?>
| </head>
|
| <body>
| <?php
| echo "<table border = '1'>";
|
| for ($counter = 0; $counter <= 5; $counter++) {
| echo "<tr><td>" . $counter . "<br></td></tr>";
|
| ob_flush();
| flush();
| sleep(1);
| }
|
| echo "</table>";
| ?>
| </body>
| </html>
|
|
| Even if I do it without a table it does not work with the Internet
| Explorer:
|
| http://test.seekware.ch/test/flush-notable.php
|
| PHP code:
| <html>
| <head>
| <?php
| header("cache-control: no-cache");
| header("pragma: no-cache");
| ?>
| </head>
|
| <body>
| <?php
| for ($counter = 0; $counter <= 5; $counter++) {
| echo $counter . "<br>";
|
| ob_flush();
| flush();
| sleep(1);
| }
| ?>
| </body>
| </html>
|
|
| Does someone know a solution which works also with the Internet
| Explorer?
|
| Regards
| Stefan
|
| PS: Both solutions work with Mozilla and Opera.
You could also try the meta+refresh HTML instruction:
<head>
<META HTTP-EQUIV=Refresh CONTENT="10; URL=http://www.htmlhelp.co m/">
<META HTTP-EQUIV=Refresh CONTENT="10">
</head>

tells the browser to load http://www.htmlhelp.com/ 10 seconds
after the current document has finished loading. Not all browsers
support this, so authors should provide an alternate means of moving
to the new page where necessary. The Refresh header is sometimes used
for "splash screens" or when a page has moved, but the technique is
not very effective since users may not even be looking at the window
that is to be refreshed. Some search engines penalize pages that use a
Refresh of a few seconds or less.
http://htmlhelp.com/reference/html40/head/meta.html
Aug 4 '08 #4
Stefan Mueller wrote:
Hallo

I'm looking for a solution to display on a web page each second a new
line.
Unfortunately does the following solution not work with the Internet
Explorer:

http://test.seekware.ch/test/flush-withtable.php

PHP code:
<html>
<head>
<?php
header("cache-control: no-cache");
header("pragma: no-cache");
?>
</head>

<body>
<?php
echo "<table border = '1'>";

for ($counter = 0; $counter <= 5; $counter++) {
echo "<tr><td>" . $counter . "<br></td></tr>";

ob_flush();
flush();
sleep(1);
}

echo "</table>";
?>
</body>
</html>
Even if I do it without a table it does not work with the Internet
Explorer:

http://test.seekware.ch/test/flush-notable.php

PHP code:
<html>
<head>
<?php
header("cache-control: no-cache");
header("pragma: no-cache");
?>
</head>

<body>
<?php
for ($counter = 0; $counter <= 5; $counter++) {
echo $counter . "<br>";

ob_flush();
flush();
sleep(1);
}
?>
</body>
</html>
Does someone know a solution which works also with the Internet
Explorer?

Regards
Stefan

PS: Both solutions work with Mozilla and Opera.
The simplest solution is to have your php generate a page with a
javascript variable loaded with your text. Then have a
javascript program that parses the text (using the current
display width) and updates the display with the additional text
each second. Not trivial and will not work if the user has js
turned off/
Aug 4 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
6466
by: ß Ø ® G | last post by:
Hi I'm trying to find a free javascript affect that will make the changes from one page to another in a browser look like the page is curling over as if the pages of a book are turning over. Does anyone know of one please. I have looked on google but the millions of pages that come up seem void of such a thing :)
5
2280
by: Rajani | last post by:
Hello, I have a strange problem. I want to check the privilege of the login user on each page and allow to display if has suff. priv. I am storing the privilege is session variable. I am checking on the page_load event like if session("uid")="" then response.redirect("loginverify.aspx?er=nlog") elseif session("priv")<>0 then response.redirect("loginverify.aspx?er=nsad")
0
1171
by: jonathan184 | last post by:
This is part of the perl script. Basically i want to try and get the second line of the error message. Now the whole error which is 5 lines long will come up if i use $Errormsg So basically i just want the second line of $errormsg to print is this possible? select TRIM(ed.created_date) Created_Date, TRIM(ed.ERRORMSG) ErrorMsg, to_char(substr(eventdata,instr(eventdata,'<ns0:SiteContractNumber>')+24, ...
0
1957
by: peridian | last post by:
Hi, I wanted a web page where I could post code to, and have it appear in coloured formatting based on the context of the code. Most of the techniques I have seen for this involve complex use of string manipulation where they seek through the string back and forth doing replacements to substitute in the needed HTML code. I am convinced that this can be done with a few regular expressions. Unfortunately my knowledge of regular...
14
23170
by: lmttag | last post by:
Hello. We're developing an ASP.NET 2.0 (C#) application and we're trying to AJAX-enable it. We're having problem with a page not showing the page while a long-running process is executing. So, we're looking for a way to display the page with a "please wait..." message while the process is running, and then, when the process is done, update the page with the actual results/page content. We have a page that opens another browser/page...
1
2125
by: jmacduff | last post by:
I would like to be able to display page load times within our asp.net application for debugging purposes , I am seeing some random slowness in our application and a load time metric would really help. Can anyone point me in the right direction? I haven't really found a good way to do it.
3
1955
by: phil67b | last post by:
Hello everybody, I have a page rech.php where I'm doing a multi-criteria research Ex. choose your car model, choose your country. After validation of my form, on the same page, the lines will be displayed (I put a max limitation of 500 lines). Ex. list of cars Fiat to buy in UK. A clic on a line will bring me to the display page disp.php Ex. I will clic on the car n° 5 =<a href="disp.php?
19
2341
by: Samuel Murray | last post by:
G'day everyone I'm trying to find out if there is a way (perhaps using CSS) to let this code: <table><tr><td>One Two Three</td></tr></table> display the same as if the code would have been:
9
4121
by: tshad | last post by:
I have a Windows App that is doing some work and then writing a "Now Processing..." line to the status line of the window as well as the Textbox on the form. But the problem is that the work is in another class from the main class. So it couldn't access the Status Line or textbox. So what we did was set them up as properties: string IStatusDisplay.Status
0
9568
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10160
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9951
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9832
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8831
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7378
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5421
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3531
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.