#39950 [NEW]: ob_start not work

From: Date: Tue, 26 Dec 2006 06:55:11 +0000
Subject: #39950 [NEW]: ob_start not work
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-106877@lists.php.net to get a copy of this message
From: phunsanit at hotmail dot com Operating system: windows xp PHP version: 4.4.4 PHP Bug Type: *General Issues Bug description: ob_start not work Description: ------------ i think ob_start not work try no appserv 2.4.7 and 2.5.7 windows xp with ajax frame work Reproduce code: --------------- // * ALL.php for Ahtoring <?php ob_start(); header('Content-Type: text/html; charset=utf-8'); define('CONTENTS', true); include_once('dynamic/dynamic.php'); echo"\n<! window fragment>\n"; if(isset($_REQUEST['modules'])){ $modules = $_REQUEST['modules']; if(isset($_REQUEST['file'])){ include_once("dynamic/modules/$modules/".$_REQUEST['file']); }else{ include_once("dynamic/modules/$modules/contents.php"); } }else{ header("location : index.php"); } /* $error = $db->sql_error($result); foreach ($error as $value) { echo "<br />$value\n"; } */ echo"\n<! window fragment>\n"; ob_end_flush(); ?> // login script <?php if (!defined('CONTENTS')) { die ('<div class="blockError">You can\'t access this file directly...</div>'); } function form(){ ?> <div align="center"> <form method="post" action="all.php?modules=Pitt_Accounts&op=login" onsubmit="return post(this ,'content');"> <table> <tr> <td colspan="2">&#3626;&#3617;&#3634;&#3594;&#3636;&#3585;&#3648;&#3586;&#3657;&#3634;&#3626;&#3641;&#3656;&#3619;&#3632;&#3610;&#3610;</td> </tr> <tr> <td>&#3594;&#3639;&#3656;&#3629;&#3648;&#3619;&#3637;&#3618;&#3585;:</td> <td><input name="username" type="text" size="15" maxlength="25" /></td> </tr> <tr> <td>&#3619;&#3627;&#3633;&#3626;&#3612;&#3656;&#3634;&#3609;:</td> <td><input name="user_password" type="text" size="15" maxlength="20" /></td> </tr> <tr> <td colspan="2"> <input type="submit" name="Submit" value="Submit" /> <input type="reset" name="Submit2" value="Reset" /> </td> </tr> </table> </form> </div> <?php } function login(){ global $db; $user = $_POST['username']; $passwd = $_POST['user_password']; $sql = "SELECT * FROM pitt_accounts WHERE username ='$user'"; $result = $db->sql_query($sql); $field = $db->sql_fetchrow($result); $pitt_uid = $field['user_id']; $adusr = $field['username']; $valid_user = strcmp($user, $adusr); $valid_passwd = strcmp(md5($passwd), $field['password']); if ($valid_user == 0 && $valid_passwd == 0) { /* &#3606;&#3657;&#3634;&#3594;&#3639;&#3656;&#3629;&#3612;&#3641;&#3657;&#3651;&#3594;&#3657;&#3649;&#3621;&#3632;&#3619;&#3627;&#3633;&#3626;&#3612;&#3656;&#3634;&#3609;&#3606;&#3641;&#3585;&#3605;&#3657;&#3629;&#3591; &#3648;&#3619;&#3634;&#3592;&#3632;&#3626;&#3619;&#3657;&#3634;&#3591; session pitt_uid &#3607;&#3637;&#3656;&#3648;&#3585;&#3655;&#3610;&#3619;&#3627;&#3633;&#3626;&#3612;&#3641;&#3657;&#3651;&#3594;&#3657; pitt_user &#3648;&#3585;&#3655;&#3610;&#3594;&#3639;&#3656;&#3629;&#3612;&#3641;&#3657;&#3651;&#3594;&#3657; pitt_group &#3648;&#3585;&#3655;&#3610;&#3585;&#3621;&#3640;&#3656;&#3617;&#3612;&#3641;&#3657;&#3651;&#3594;&#3657; */ $ip = ''.getenv("REMOTE_ADDR").''; $time = 'sign in '.date("Y-m-d ,H:i").''; $sql="INSERT INTO pitt_accounts_log ( user_id , sign , ip ) VALUES ( '$pitt_uid', '$time', '$ip');"; $db->sql_query($sql); /* CSLOX &#3651;&#3594;&#3657; php V4.3.1 &#3617;&#3637; BUG &#3652;&#3617;&#3656; SUBPORT output buffering 1 &#3627;&#3657;&#3634;&#3617;&#3626;&#3656;&#3591;&#3586;&#3657;&#3629;&#3617;&#3641;&#3621;&#3585;&#3656;&#3629;&#3609; COOKIE / SESSION 2 &#3648;&#3619;&#3637;&#3618;&#3591;&#3594;&#3639;&#3656;&#3629;&#3605;&#3633;&#3623;&#3649;&#3611;&#3619;&#3604;&#3657;&#3623;&#3618; ? 3 &#3623;&#3656;&#3634;&#3591;&#3654; &#3626;&#3656;&#3591; chang Log &#3652;&#3611;&#3651;&#3627;&#3657;&#3604;&#3641;&#3604;&#3657;&#3623;&#3618; */ setcookie('pitt_uid' ,$pitt_uid ,time()+2592000); // setcookie('pitt_group' ,$field['group'] ,time()+2592000); setcookie('pitt_user' ,$adusr ,time()+2592000); $_SESSION['pitt_group'] = $field['group']; $client++; setcookie("client[$client]", urlencode("window.parent.location='admin.php?session=".rand()."';")); }else{ $client++; setcookie("client[$client]", urlencode("alert('&#3619;&#3627;&#3633;&#3626; &#3627;&#3619;&#3639;&#3629; &#3594;&#3639;&#3656;&#3629;&#3612;&#3641;&#3657;&#3651;&#3594;&#3657;&#3612;&#3636;&#3604;');")); } } switch($_REQUEST['op']){ case 'login': { login(); break;} case 'logout' : { setcookie('pitt_uid'); setcookie('pitt_user'); unset($_SESSION['pitt_group']); $client++; setcookie("client[$client]", urlencode("window.parent.location='admin.php?session=".rand()."';")); break; } default : { form(); } } ?> Expected result: ---------------- Warning: Cannot modify header information - headers already sent by (output started at C:\AppServ\www\SCT_CSS\all.php:1) in C:\AppServ\www\SCT_CSS\all.php on line 3 &#65279;&#65279;&#65279; Warning: Cannot modify header information - headers already sent by (output started at C:\AppServ\www\SCT_CSS\all.php:1) in C:\AppServ\www\SCT_CSS\dynamic\modules\Pitt_Accounts\contents.php on line 68 -- Edit bug report at http://bugs.php.net/?id=39950&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=39950&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=39950&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=39950&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=39950&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=39950&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=39950&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=39950&r=needscript Try newer version: http://bugs.php.net/fix.php?id=39950&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=39950&r=support Expected behavior: http://bugs.php.net/fix.php?id=39950&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=39950&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=39950&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=39950&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=39950&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=39950&r=dst IIS Stability: http://bugs.php.net/fix.php?id=39950&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=39950&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=39950&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=39950&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=39950&r=mysqlcfg

« previous php.bugs (#106877) next »