473,325 Members | 2,671 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

preventing buffered output

Hi,

What directives/headers can I add to my PHP page so that output is
displayed on my HTML browser as it is received as opposed to waiting to
receieve it all and then displaying it? Ideally, this solution would
work for PC IE 6, Firefox, and Safari,

Thanks for the help, - Dave

Feb 4 '06 #1
4 1368
la***********@zipmail.com wrote:
Hi,

What directives/headers can I add to my PHP page so that output is
displayed on my HTML browser as it is received as opposed to waiting to
receieve it all and then displaying it? Ideally, this solution would
work for PC IE 6, Firefox, and Safari,

Thanks for the help, - Dave


some well placed flush(); commands work for me....

do stuff
flush();
do more stuff
flush();

etc...
M.
Feb 4 '06 #2

noone wrote:
la***********@zipmail.com wrote:
Hi,

What directives/headers can I add to my PHP page so that output is
displayed on my HTML browser as it is received as opposed to waiting to
receieve it all and then displaying it? Ideally, this solution would
work for PC IE 6, Firefox, and Safari,

Thanks for the help, - Dave

some well placed flush(); commands work for me....

do stuff
flush();
do more stuff
flush();

etc...


That's one option. Another would be to enable implicit flush in
php.ini:

<http://www.php.net/manual/en/ref.outcontrol.php#ini.implicit-flush>

This will probably slow things down consderably, though. Also remember
that, regardless of what you tell PHP to do, the webserver itself may
be doing some buffering. M.


Feb 4 '06 #3
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

la***********@zipmail.com wrote:
What directives/headers can I add to my PHP page so that output is
displayed on my HTML browser as it is received as opposed to waiting to
receieve it all and then displaying it? Ideally, this solution would
work for PC IE 6, Firefox, and Safari,


Aside from flushing he buffer, you should care about how the different
browsers render the page.

In particular, you can run into problems if you are using MSIE, and if your
data is inside some tables. IIRC, MSIE will wait until the inner elements
of the table have been fully loaded, in order to calculate its geometry
(width and height), and render it.

Step away from using complicated table-based HTML layouts, and try to use
CSS-based layouts, and absolute positioning. You will surely see that some
layouts render more quickly than others.

- --
- ----------------------------------
Iván Sánchez Ortega -i-punto-sanchez--arroba-mirame-punto-net

http://acm.asoc.fi.upm.es/~mr/ ; http://acm.asoc.fi.upm.es/~ivan/
MSN:i_*************************@hotmail.com
Jabber:iv*********@jabber.org ; iv*********@kdetalk.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQFD5WEd3jcQ2mg3Pc8RAmTYAKCGY+TA69OKHG7zif8FAX qMR1FcjwCeJj2T
eK3T8VsBXFhybNR0Q0Y2+YM=
=OBm2
-----END PGP SIGNATURE-----
Feb 5 '06 #4
la***********@zipmail.com wrote:
Hi,

What directives/headers can I add to my PHP page so that output is
displayed on my HTML browser as it is received as opposed to waiting to
receieve it all and then displaying it? Ideally, this solution would
work for PC IE 6, Firefox, and Safari,


This usernote might help <http://in2.php.net/flush#52147>

--
<?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/

Feb 5 '06 #5

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

Similar topics

2
by: D. Alvarado | last post by:
Hello, I am running PHP 4 on Apache 1.31 for Fedora Core 2 Linux. I run a process exec("/bin/sh $my_script", $output, $return); that takes about 15-20 seconds but produces multiple lines of...
5
by: evan | last post by:
I am calling a C function from a C++ method as follows: int mem_if::read(void) { int i; for(i = 0; i < 5; i++) { printf("A"); E2Read(i); } return size; }
7
by: Steven T. Hatton | last post by:
I haven't looked very closely, but from what I'm seeing, it looks like there are no buffered I/O streams in the Standard Library. There are stream buffers, but not buffered streams. I don't have...
9
by: kernelxu | last post by:
hi,everybody. I calling function setbuf() to change the characteristic of standsrd input buffer. some fragment of the progrem is: (DEV-C++2.9.9.2) #include <stdio.h> #include <stdlib.h> int...
4
by: pank7 | last post by:
hi everyone, I have a program here to test the file IO(actually output) with buffer turned on and off. What I want to see is that there will be obvious differece in time. Here I have an input...
2
by: Karl | last post by:
Hey everyone! I've got a quick question on whether std::ifstream is buffered or not. The reason is that I have a homework assignment that requires me to benchmark copying files using different...
12
by: lh84777 | last post by:
Hello, i'm looking for this behaviour and i write a piece of code which works, but it looks odd to me. can someone help me to refactor it ? i would like to walk across a list of items by...
1
by: hafertepen | last post by:
preventing sqlplus output to terminal from UNIX - I've forgot, please help!
8
by: zeeshan708 | last post by:
what is the difference between the buffered and unbuffered stream ??(e.g we say that cout is buffered and cerr is unbuffered stream) does that mean that the output sent to buffered stream have to go...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.