note 75115 added to function.flush
| From: | mbilliet at gmail dot com | Date: | Sun, 13 May 2007 10:13:22 +0000 |
| Subject: | note 75115 added to function.flush | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-126473@lists.php.net to get a copy of this message | ||
Hello,
I had the same problems with sending a javascript after the <body></body> content has
been sent to the browser (the script updates the content of an iframe).
Two solutions work for me:
- add enough data (i.e.: extra dummy text like spaces) or,
- echo the '</body>' tag at the end of the page
Note, that for the latter to work one should:
- turn of output_buffering in php.ini and either:
* turn on implicit_flush in its php.ini or,
* call ob_implicit_flush(); at the beginning of a script
I preferr echoing the '</body>' tag at the end as it doesn't require any extra
data to be sent over the wire and its much a neater coding technique.
Notes:
- these worakarounds aren't needed when using perl and cgi,... .
- you can leave the zlib.output_compression in your php.ini switched on
Kind regards and hoped this is of any help.
Maurits
----
Server IP: 193.190.198.20
Probable Submitter: 213.219.169.64
----
Manual Page -- http://www.php.net/manual/en/function.flush.php
Edit -- https://master.php.net/note/edit/75115
Del: integrated -- https://master.php.net/note/delete/75115/integrated
Del: useless -- https://master.php.net/note/delete/75115/useless
Del: bad code -- https://master.php.net/note/delete/75115/bad+code
Del: spam -- https://master.php.net/note/delete/75115/spam
Del: non-english -- https://master.php.net/note/delete/75115/non-english
Del: in docs -- https://master.php.net/note/delete/75115/in+docs
Del: other reasons-- https://master.php.net/note/delete/75115
Reject -- https://master.php.net/note/reject/75115
Search -- https://master.php.net/manage/user-notes.php