Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-15-2009, 12:54 AM   PM User | #1
johnnnn
New Coder

 
Join Date: May 2009
Location: Pennsylvania, United States
Posts: 54
Thanks: 16
Thanked 0 Times in 0 Posts
johnnnn is an unknown quantity at this point
Question ob_start question

I've started looking into the output buffering functions in the manual, I think I sort of understand what they're user for, but I'm not 100% sure.

For example:

PHP Code:
<?php
if(is_authorized()) {
ob_start();
echo 
"Hello, your are logged in!";


if(isSet(
$_GET['action']) && $_GET['action'] == 'home') {
ob_end_flush();
// some more out put here! 
}

ob_end_clean();

?>
Is that a correct way to use these functions...can someone please explain?!

Thanks! :]
johnnnn is offline   Reply With Quote
Old 12-15-2009, 07:32 AM   PM User | #2
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,678
Thanks: 158
Thanked 2,182 Times in 2,169 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
Quote:
Is that a correct way to use these functions...can someone please explain?!
Do you really need to use that function? It's not a good practice to rely much on this as it may take more resources from server. You could avoid use of it by a wise design of your system.
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
abduraooft is offline   Reply With Quote
Reply

Bookmarks

Tags
buffering, coding, ob_, ob_start, output

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:41 AM.


Advertisement
Log in to turn off these ads.