Jump to content

[SOLVED] Retrieve the outputted page


wob_b

Recommended Posts

Oh, I see. Well you can do something like this:

 

<?php
session_start();
ob_start();

echo <<<END
All your page's output here
END;

$_SESSION['var'] = ob_get_contents();
?>

 

$_SESSION['var'] will then include everything that was output on the page.

alex never seen ob_start() after the session_start is that new?

 

 

sorry i get it works with the ob_start();

 

then

 

ob_get_contents to get what in between the two functions.

ob_start() isn't related to session_start(), ob_start() is just to turn output buffering on so that you can catch all the output of the page and set it to a session variable later on through ob_get_contents().

 

Check them out, ob_start(), ob_get_contents()

but , if ob_start() dose not go before the session_start() user's still get there errors.

 

that because they got HTML or wight spaces before session_start() i guess?

It doesn't matter either way because ob_start() doesn't output anything (So you won't get a headers already sent error if you call ob_start() first).

 

So..

 

session_start();
ob_start();

or

ob_start();
session_start();

 

There will be no difference.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.