Jump to content

session_start() help needed please!!


beemer832

Recommended Posts

First want to start by saying these pages work perfect on my own hosted devel server running centos5. I am moving these to godaddy for production and am running into this error:

 

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/content/93/6413093/html/classifieds/login.php:7) in /home/content/93/6413093/html/classifieds/init.php on line 2

 

The first page you browse to is index.php:

<?
header('location: secured_page.php');
?>

 

Header refers it to secured_page.php:

<?
require('init.php');
?>

Then there is a bunch of HTML code under neath this page. This is the secured (password protected) page.

 

The init.php that is required:

<?
session_start();
require('config.php');
require('quotes.php');

With more PHP code under neath.

 

The first 7 lines of the login.php page are all HTML code. The 7th line in this page that is PHP is:

: sha1(sha1($_REQUEST['password']).$_SESSION['salt']);

 

I cannot for the life of me figure out why this is happening. Checked for whitespace and characters before the session_start() in the init.php file. Any and all help is greatly appreciated.

 

thanks

-beemer

 

 

Link to comment
Share on other sites

First want to start by saying these pages work perfect on my own hosted devel server running centos5. I am moving these to godaddy for production and am running into this error:

 

You should always develop on a server with php configured to display errors and have error reporting on and configured to show ALL types of errors.

 

which page do you add the: ob_start();

??

 

thanks

-beemer

 

You don't. Fix your code. The error says that output is starting on line 7, figure out where that is and remove whatever is causing output.

Link to comment
Share on other sites

Error handling was on with the devel server, just making the point that Godaddy does not have a very good default php.ini file. I am using the same error handling on both servers now.

 

Not trying to have someone else fix my code, just trying to understand why it works on one server, but not the other. I am under the assumption that the header() redirect on the index.php is sending output to the browser. Will investigate further.

 

thanks

-beemer

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.