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
0 answers

wordpress shortcode strange behaviour on password protected page

I've written a wordpress plugin for a friends homepage. It should output a form on a password protected page. I've written this plugin on march 2013. The form is included into the page via shortcode. At that time I printed my output directly via…
Sebastian Bechtel
  • 363
  • 1
  • 3
  • 12
0
votes
2 answers

Flushing output to browser, carriage return and overwrite?

I'm experimenting here with output buffering and am stuck on carriage returns, overwrites. Basically, if I run this snippet in CLI:
tomsseisums
  • 13,168
  • 19
  • 83
  • 145
0
votes
1 answer

PHP: What happens after ending output buffering

I have some code which does the following: I can see $something but not $another_thing; According to the manual ob_end_flush() just turns off output buffering,…
ec2011
  • 570
  • 6
  • 20
0
votes
2 answers

Echo dynamic content in the middle of a page based on various conditions defined in the head

I am trying to dynamically echo some predefined template ('template-file-for-output.php') filled with some data (from the $var array) on a specific place in a number of pages (as an example, the page 'page.php'). Basically my goal is to have a…
Iam Zesh
  • 1,797
  • 2
  • 20
  • 42
0
votes
1 answer

Do the PHP output buffers record and hold only echoed things inside php, or echoed things AND html code written outside of php tags?

And could I activate output buffers during all my PHP code running, then search and replace things in the entire page like the title or meta description later then when I wrote them in the code ? My code is written after the head and it got pretty…
Guillaume Chevalier
  • 9,613
  • 8
  • 51
  • 79
0
votes
2 answers

Flushing HTML to Browser using PHP

I am trying to implement the trick listed on this page http://developer.yahoo.com/performance/rules.html#flush "Flush the Buffer Early". Everytime I try to run this thing I am not getting the desired output. I have written the following…
Manu
  • 901
  • 1
  • 8
  • 28
0
votes
1 answer

C language: write to file without buffering

I have opened a file for writing some data to a file, but it keeps buffering and won't write anything to the file until the program ends. How can I skip the buffering process and write directly to the file. My code: fprintf (fp, "# Step: %d %f\n",…
Vahid Mirjalili
  • 6,211
  • 15
  • 57
  • 80
0
votes
0 answers

Emailing php output

I have built a jquery mobile form that submits to a php file. I want the following php output to also have the option of emailing it to the user.
Ann Holley
  • 39
  • 2
  • 6
0
votes
2 answers

Multidimensional $_SESSION variables not being set before header redirect

I have a basic form submission script that sets multidimensional $_SESSION variables (2 levels) from a loop - then redirects using header location. I developed this on my local machine (xampp/windows server running PHP 5.3.8) without problems but I…
0
votes
1 answer

Why do I need to use many flushing functions to flush the output buffer (using wamp, PHP)

In wamp server, I cannot flush the output buffer unless I use these functions: ob_end_flush(); ob_flush(); flush(); ob_start(); Why do I need to use all of these functions? Why does simple ob_flush() is not working? my code :
user1735111
0
votes
2 answers

Output buffering, hierarchical?

Output buffering in PHP is fun. It simplifies many things. I use ob_start() at the top of the script and ob_get_clean() (or any other function) at the bottom. Between those two calls is it possible to call those functions again, without interfering…
user1899812
0
votes
1 answer

Doing away with Output Buffering

My login script is something like this, usually included on top of the login form:
bodesam
  • 529
  • 4
  • 9
  • 24
0
votes
1 answer

PHP Output Buffer "Millenium" Bug?

I faced a strange issue today. For several months I used buffer flushing in PHP to send small string sizes to the client without problems. Today I returned to the project and it turned out that my server won't send strings smaller than 512…
Julian F. Weinert
  • 7,474
  • 7
  • 59
  • 107
0
votes
1 answer

Php ob_get_contents fail

I am using ob_get_contents() to create a html file from php file. On development machine sometimes it works but on the test machine it did not work.
//some html content
cgrgcn
  • 361
  • 2
  • 6
  • 24
0
votes
1 answer

How to keep Ads from being called during a redirect?

On one of my class-based sites, everything is controlled via the index.php page, and every page is its own class that gets called via that index page. In one of those classes lies both the logged-in and logged-out header that gets called for every…
ProgrammerGirl
  • 3,157
  • 7
  • 45
  • 82