PHP login error: Cannot send session cache limiter - headers already sent?

  • Thread starter Thread starter Cathy V
  • Start date Start date
C

Cathy V

Guest
I'm learning PHP/mysql.

I'm trying to create a login session for users.

I've inserted the following code in my main login page ( the one that receives username and password inputs):

if($numrows>0)
{
$row = mysql_fetch_assoc($data);
$a=$row['myusername'];
session_register($a);
header("Location:/login_success.php");
}

But I keep receiving the following error messages from the page:

"Cannot send session cache limiter - headers already sent.
Cannot modify header information - headers already sent"

1.Can anyone help me with the code?
2.What code should I put on the login_success.php page to retrieve the session's registered variable $a( this page is the member area).
3. I put the following code in the logout.php page:

session_start();session_destroy()

but
I still can access the members' area -where I'm still logged in- by hitting the browser's back button.

SOS please! Thank you sooooooo much for your help
 
Back
Top