Questions tagged [output-buffering]

Use output-buffering for questions related to the use of one or more buffers in order to optimize performance by batching write operations

References

414 questions
0
votes
2 answers

ob_start output_callback can not access global variables

I'm currently using output buffering for some sort of header & footer automatization. But I need to access global variables inside the output_callback function. If I don't use class oriented code there isn't any issue. But if I try something…
intacto
  • 451
  • 4
  • 12
0
votes
1 answer

how can i find out if the php output already started?

Possible Duplicate: PHP: how to know if output already started? I would like to find out if there is already generated output in the buffer before I start the session. In PHP, an output that started before the session started always creates a…
rubo77
  • 19,527
  • 31
  • 134
  • 226
0
votes
3 answers

Webpage consistently didn't work the first time it was loaded. Why was output_buffering causing problems?

I want to share a problem I had, the fix I found and then ask a question about the reason behind the fix. The problem After upgrading to wampserver 2.2, one of my webpages consistently didn't work the first time it was loaded in the browser. This…
TryHarder
  • 2,704
  • 8
  • 47
  • 65
0
votes
1 answer

PHP usleep/sleep inside output buffer

I have a PHP application containing these files: landing.php, redirect.php, ajax.php on a page call to landing.php, I execute a javascript code to capture certain data, and issue an AJAX POST to ajax.php which inserts them into DB. Finally php…
hoball
  • 3,146
  • 5
  • 23
  • 15
0
votes
0 answers

PHP Output Buffering with included files

I have one file will include other files depending on some conditions, One of these files needs to use output buffering so that the response can be returned to the browser and then some slow actions performed after. If I run the file that I want to…
Chris
  • 3,036
  • 5
  • 36
  • 53
0
votes
1 answer

If I use buffering will that have significant effect on performance?

I have a client who wants his script to be tweaked for some modifications. Unfortunately, most of the code is 'ionCubed'. Now I thought I can use ob_start($callback) to buffer the output and change it by using RegExes. My question is will that have…
Shubham
  • 21,300
  • 18
  • 66
  • 89
0
votes
1 answer

PHP URL Rewriting from Output Buffer

I am trying to rewrite my URLs in PHP using the output buffer. Ideally this is so in my source I can keep my links as example.com/index.php?action=123;sa=456;sa2=789 but when outputted to the browser it rewrites as example.com/123/456/789 It seems…
Ed R
  • 2,129
  • 6
  • 24
  • 32
0
votes
3 answers

PHP: How can I cache a page using output buffer?

I'm trying to cache a page that gets/processes data from very slow API's - so I can load it quickly to the user. But for some reason the output buffer is empty?
Joe
  • 457
  • 3
  • 8
  • 26
0
votes
1 answer

making the output appear faster on the client browser

When I process large records in a while loop and each iteration of the loop outputs some info for the screen, I always find myself looking at an old screen. All I see is the activity icon spinning - which indicates that the server is processing some…
Average Joe
  • 4,521
  • 9
  • 53
  • 81
0
votes
2 answers

Is it possible to change the content/mime type of ajax results?

I am using output buffering to grab a pdf file from a network share via PHP using a proxy-handler and readfile(). I display this in a new browser tab by specifying the content/mime type.…
James Pitt
  • 451
  • 2
  • 8
  • 19
0
votes
4 answers

PHP Output buffering contains something before script starts

i have a site, where i buffer some output with ob_start(); ... and it worked fine until today i updated my debian from an older php5.3 to the latest php5.3.3-7+squeeze8 Now i sometimes have something in the output buffer before i call it the…
rubo77
  • 19,527
  • 31
  • 134
  • 226
-1
votes
1 answer

Headers already sent, makes no sense works in case A, not B?

The code below works fine, it returns a list of navagation links and gives them unique colors, but why does adding '' give me header output errors? Removing it makes…
-1
votes
2 answers

php outbuffering and header

I am using php 5.3.6 and below is my code and it is producing an error Warning: Cannot modify header information - headers already sent by (output started at ............ "; $loop = true; $counter =…
Prakash
  • 2,749
  • 4
  • 33
  • 43
-1
votes
1 answer

Flushing stdout messages of c/c++ based executable

My question is general and doesn't relate to a specific debugging scenario. When a program terminate unexpectedly (panic, memory corruption, access violation etc... ) , sometimes the recent stdout messages doesn't appear on the screen, even though…
Zohar81
  • 4,554
  • 5
  • 29
  • 82
-1
votes
1 answer

How do I get the absolute last output from buffer?

I am trying to use REDIS caching outside of wordpress, and in my index.php, I'm basically wrapping the two PHP lines to start output buffering and end output buffering... however, it's not working as expected. ob_start(); define('WP_USE_THEMES',…
Rob W
  • 9,134
  • 1
  • 30
  • 50
1 2 3
27
28