FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


problem when using ob_start("ob_gzhandler") on php





Philip
i created a portal that using phpbb, and i readed a post on www.frihost.com that ob_start("ob_gzhandler") can improve speed for browsing. indeed it increasing but it seem

after a second and open other pages, i logouted from phpbb system, i dont know why, can someone suggest me what wrong ?

my code is like this..
index.php
Code:
<?
   header('Cache-Control: no-cache');
   error_reporting(0);
   clearstatcache();
   include('password.php');
   define('IN_PHPBB', true);       
   $phpbb_root_path = './phpBB2/';
   include($phpbb_root_path . 'extension.inc');
   include($phpbb_root_path . 'common.'.$phpEx);
   include($phpbb_root_path . 'includes/functions_mod_user.'.$phpEx);
   //
   // Start session management
   //
   $userdata = session_pagestart($user_ip, PAGE_INDEX);
   init_userprefs($userdata);
   //
   // End session management
   //

   ob_start("ob_gzhandler");

?>
contain
<?
ob_flush();   
?>


thanks,
shamil
Try this:
Code:
<?
   ob_start("ob_gzhandler");
   header('Cache-Control: no-cache');
   error_reporting(0);
   clearstatcache();
   include('password.php');
   define('IN_PHPBB', true);       
   $phpbb_root_path = './phpBB2/';
   include($phpbb_root_path . 'extension.inc');
   include($phpbb_root_path . 'common.'.$phpEx);
   include($phpbb_root_path . 'includes/functions_mod_user.'.$phpEx);
   //
   // Start session management
   //
   $userdata = session_pagestart($user_ip, PAGE_INDEX);
   init_userprefs($userdata);
   session_write_close();
   //
   // End session management
   //


?>
contain
<?
ob_flush();   
?>

You should take a look at readers' comments http://www.zend.com/zend/art/buffering.php?article=buffering&kind=a&id=2636&open=1&anc=0&view=1
Philip
wew, i tested it and worked Smile

thanks.
Related topics
How To : Improve Your PHP Programming
managing a bilingual site
[PHP] Error link
Reducing Exploits
PHP include code problem
using cookies in PHP
How to edit SQL files?
PHP script problem
Hot to change "Reset Ownership" using php?
PHP SOAP error
Using PHP "OR" Logical Operator
Site load in half time (with no browser compatibility issue)
C++ Using class methods in inline functions? Scope problem?
PHP Includes Problem
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.