Jump to content

PHP Login Disappeared


Bin

Recommended Posts

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
Share on other sites

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
Share on other sites

<?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
Share on other sites

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
Share on other sites

<?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
Share on other sites

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
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.