Questions tagged [ob-start]

ob_start is a PHP function which turns output buffering on. While output buffering is active no output is sent from the script (other than headers), instead the output is stored in an internal buffer.

190 questions
0
votes
2 answers

min-height CSS property doesn't work while buffering output with PHP ob_start()

I'm actually working on a PHP project using MVC structure, including DOCTYPE & HEAD tag via a single file during an output buffering using ob°start(). The problem comes when i wanna declare a min-height property for may page container, in order to…
jst
  • 141
  • 2
  • 10
0
votes
1 answer

How can I deactivate ob_start('gz_handler') during the same session?

In my php project I'm using ob_start('gz_handler'); at the start of every page. But when it comes to downloading zip files I'm getting problems with some browsers. So I need to deactivate it just there. So what's the opposite of…
C. S.
  • 127
  • 1
  • 2
  • 8
0
votes
1 answer

Refresh page after the background script is done

I am using ob_ to do some background processing $buffer = ob_get_contents(); header("Connection: close"); ignore_user_abort(true); ob_start(); echo $buffer; $size=ob_get_length(); header("Content-Length:…
Benn
  • 4,840
  • 8
  • 65
  • 106
0
votes
1 answer

how to create a progress bar using php output buffering and jquery?

how to create a progress bar using php output buffering and jquery? i been searching this for weeks, i am desperate to learn this, this is a very big help for me, is someone the here share some codes? i know the this will need to script. i have…
avien
  • 177
  • 5
  • 14
0
votes
1 answer

Using foreach loop, how can we echo data with ob_start()

We have designed a Progress bar, using Jquery Ui. we need a program that can deliver data in numeric value. That code is not working PHP CODE
PPS
  • 7
  • 5
0
votes
2 answers

PhP Headers and output buffering

So... if you have a script that states something like so... while($result = mysql_fetch_array($resource)) { if($result['TITLE'] == $this->title) { header("LOCATION: profile.php?error=11"); } echo…
Highspeed
  • 442
  • 3
  • 18
0
votes
1 answer

People are downloading corrupted PDF's from my website

I'm currently working on a website I did not personally developped. It's is wordpress based, but a lot of developement had been made to it by external people. We have a problem with some pdf's. When people are downloading these pdf's or even images,…
0
votes
2 answers

ob_start /ob_get_clean to Email html php content/results

I'm sure there are other better methods that I'm unaware of- just trying to take the simplest approach. Will post additional code as needed: Selection php results from previous page:
Commandrea
  • 561
  • 3
  • 10
  • 24
0
votes
2 answers

PHP ob_start skeleton only working first time

I have browsed around the suggested titles and found some answers but nothing that really worked, and so I turn to you... I have a function that uses ob_start() to call a file from which the contents are used as a skeleton. Once the contents have…
Nick
  • 93
  • 1
  • 1
  • 6
-1
votes
2 answers

ob_start() and ob_implicit_flush(true) using at the same time cause an issue

I need to echo some output while executing php file ,beacuse execution takes 10 sec and end of 10sec page should be directed via header("Location:test.php) However If I use ob_start and ob_implicit_flush(true) at the same time , we cannot direct…
-1
votes
1 answer

Turn php loop output to variable?

I am still learning php and this is how i convert php loop statement output to variable:: ob_start(); if 2 > 1 { echo 'It is OK'; } else { echo 'It is not OK'; } $myvar = ob_get_clean(); echo $myvar; Now the $myvar will output above if result,…
magix01
  • 150
  • 1
  • 3
  • 10
-1
votes
1 answer

Why does the buffer not output anything when called more than once?

I have a PHP file called test.php that contains the following code. '; var_dump($html2); echo ''; $text =…
Casey
  • 19
  • 2
-1
votes
1 answer

Decode ob_start() data

This is definitely a newbie question, since I'm not sure where to start on this. I've used a PHP anti-spam form email script for years which was purchased from a developer (who has ceased their business) but is sometimes flagged as suspicious by our…
Dan
  • 931
  • 2
  • 18
  • 31
-1
votes
2 answers

Redirecting to other PHP page

I have tried all methods but still am not seeing a redirect to index.php as expected. I also added ob_start() but it doesn't work. Then I tried header('location:...'). It also didn't work. Then I tried to redirect using JavaScript but that also…
fahad pirzada
  • 103
  • 10
-1
votes
6 answers

ob_get_clean - how to str_replace two variables?

At the top of my page I have a breadcrumb. ob_start();
  • ##product##
  • ##category##
  • After this, I run mysql query to get the variables: $product $category then I run:
    user3312792
    • 1,101
    • 2
    • 12
    • 27
    1 2 3
    12
    13