Bin Posted October 9, 2008 Share Posted October 9, 2008 Hello Everyone. I have a very strange situation at one of my application login page. I received the following errors These are the errors I am receiving in regards to PHP folderpath [Date] PHP Warning: session_start() [<a href='function.session-start'>function.session-start</a>]: Cannot send session cache limiter - headers already sent (output started at /home/positix6/public_html/pform/index.php:2) in /home/positix6/public_html/pform/incCommon.php on line 35 folderpath [Date]PHP Warning: Cannot modify header information - headers already sent by (output started at /home/positix6/public_html/pform/index.php:2) in /home/positix6/public_html/pform/incCommon.php on line 36 folderpath [Date] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/positix6/public_html/pform/index.php:2) in /home/positix6/public_html/pform/incCommon.php on line 37 I was suggested to check for spaces before your opening <?php tag at might be the most likely cause. I did all that but still I can't see that login options (Username and Password) boxes. I didn't change anything in the code and everything was working fine few days back but suddenly the portion mentioned above just disappeared. I would really appreciate anyone's help since this is quite frustrating and frankly strange. Thanks Bin. Link to comment https://forums.phpfreaks.com/topic/127645-php-login-disappeared/ Share on other sites More sharing options...
DarkWater Posted October 9, 2008 Share Posted October 9, 2008 We'd need to see incCommon.php, specifically the first like 40 lines. Link to comment https://forums.phpfreaks.com/topic/127645-php-login-disappeared/#findComment-660536 Share on other sites More sharing options...
Bin Posted October 9, 2008 Author Share Posted October 9, 2008 Here it is!! <?php ob_start(); // check if setup was performed or not yet $setupStyle="border: solid 1px red; background-color: #FFFFE0; color: red; font-size: 16px; font-family: arial; font-weight: bold; padding: 10px; width:400px; text-align: left;"; if(!is_file(dirname(__FILE__)."/config.php")){ ?> <center> <div style="<?php echo $setupStyle ?>"> Program setup was not performed yet. Please log in to the <a href="setup.php">setup page</a> first. </div> </center> <?php exit; } if(!is_file(dirname(__FILE__)."/admin/incConfig.php")){ ?> <center> <div style="<?php echo $setupStyle ?>"> Admin setup was not performed. Please log in to the <a href="admin/">admin control panel</a> to perform the setup. </div> </center> <?php exit; } // ----------------------------------------- include(dirname(__FILE__)."/admin/incFunctions.php"); include(dirname(__FILE__)."/admin/incConfig.php"); session_start(); header("Cache-Control: no-cache, must-revalidate"); header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // check if membership system exists setupMembership(); // do we have a login request? if($_POST['signIn']!=''){ if(logInMember()){ redirect("index.php"); } } Link to comment https://forums.phpfreaks.com/topic/127645-php-login-disappeared/#findComment-660545 Share on other sites More sharing options...
DarkWater Posted October 9, 2008 Share Posted October 9, 2008 Can you also please post the first 15 lines of index.php? And PLEASE use tags to make your code readable. Link to comment https://forums.phpfreaks.com/topic/127645-php-login-disappeared/#findComment-660551 Share on other sites More sharing options...
Bin Posted October 9, 2008 Author Share Posted October 9, 2008 <?php if (!isset($_SESSION)) { session_start(); } ?> <?php include(dirname(__FILE__)."/incCommon.php"); include(dirname(__FILE__)."/header.php"); ?><link rel="stylesheet" type="text/css" href="style.css"><?php if($_GET['signOut']==1){ logOutMember(); } $arrTables=getTableList(); ?><div class="TableFooter" align="right"> </div> </div> <div align="center"><img src="/pform/images/logo2.jpg" width="186" height="77" /> <br> </div> Link to comment https://forums.phpfreaks.com/topic/127645-php-login-disappeared/#findComment-660570 Share on other sites More sharing options...
Bin Posted October 10, 2008 Author Share Posted October 10, 2008 Anyone with any idea regarding this issue?? Link to comment https://forums.phpfreaks.com/topic/127645-php-login-disappeared/#findComment-661520 Share on other sites More sharing options...
DarkWater Posted October 10, 2008 Share Posted October 10, 2008 Sorry, went out with some friends. Remove session_start() from the incCommon.php on line 35 and all the errors should go away. Link to comment https://forums.phpfreaks.com/topic/127645-php-login-disappeared/#findComment-661524 Share on other sites More sharing options...
Bin Posted October 10, 2008 Author Share Posted October 10, 2008 I am afraid its still the same. Any more ideas of information that your require to do some in depth trouble shooting? Link to comment https://forums.phpfreaks.com/topic/127645-php-login-disappeared/#findComment-661550 Share on other sites More sharing options...
Asheeown Posted October 10, 2008 Share Posted October 10, 2008 Limit the session starts and the header changes to one common page only, for instance if incCommon.php is going to be directly or indirectly included on a page it can hold the session_start() and header details and the rest of the pages don't need to set it if they are called after this page. Link to comment https://forums.phpfreaks.com/topic/127645-php-login-disappeared/#findComment-661568 Share on other sites More sharing options...
Bin Posted October 10, 2008 Author Share Posted October 10, 2008 I am sorry but can you please elaborate on your point of view. I am not php developer. Thanks Bin. Link to comment https://forums.phpfreaks.com/topic/127645-php-login-disappeared/#findComment-661592 Share on other sites More sharing options...
redarrow Posted October 10, 2008 Share Posted October 10, 2008 <?php session_start(); include(dirname(__FILE__)."/incCommon.php"); include(dirname(__FILE__)."/header.php"); ?> <link rel="stylesheet" type="text/css" href="style.css"> <?php if($_GET['signOut']==1){ logOutMember(); } $arrTables=getTableList(); ?> <div class="TableFooter" align="right"> </div> </div> <div align="center"><img src="/pform/images/logo2.jpg" width="186" height="77" /> <br> </div> Link to comment https://forums.phpfreaks.com/topic/127645-php-login-disappeared/#findComment-661683 Share on other sites More sharing options...
redarrow Posted October 10, 2008 Share Posted October 10, 2008 your code would off worke just stick a ob_flus_end(); at the end off the page....... Link to comment https://forums.phpfreaks.com/topic/127645-php-login-disappeared/#findComment-661687 Share on other sites More sharing options...
Bin Posted October 11, 2008 Author Share Posted October 11, 2008 That didn't work. However I am getting this error after removing session_start() from inCommon.php and placing session_start() at the beginning of index.php. Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/positix6/public_html/pform/index.php:1) in /home/positix6/public_html/pform/index.php on line 3 Warning: Cannot modify header information - headers already sent by (output started at /home/positix6/public_html/pform/index.php:1) in /home/positix6/public_html/pform/incCommon.php on line 34 Warning: Cannot modify header information - headers already sent by (output started at /home/positix6/public_html/pform/index.php:1) in /home/positix6/public_html/pform/incCommon.php on line 35 Any ideas ?? Link to comment https://forums.phpfreaks.com/topic/127645-php-login-disappeared/#findComment-662466 Share on other sites More sharing options...
awpti Posted October 11, 2008 Share Posted October 11, 2008 Something, somewhere is outputting data before sessions start. This is the problem. Unfortunately, we can't see your exact setup or your files. Best thing to do is step through your code bit by bit until you find the source of the error (abuse exit; and die() statements). Link to comment https://forums.phpfreaks.com/topic/127645-php-login-disappeared/#findComment-662475 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.