first of all, let me thank you - all of you - for your great help. I know I have a hard time learning these basic stuffs so many thanks for your patience. 
Here are a few problems that I have.
Here is my login page:
Code:
$sql = "SELECT username, password FROM huh WHERE username = '$username' AND password = '$password' LIMIT 0,1";
$result = mysql_query($sql);
if ( mysql_num_rows($result) == 1 ) // mysql_num_rows() returns the record count from the query result. you want one (1) matching record to verify the login was successful.
{
$_SESSION['loggedin'] = 1; // Setting session var 'loggedin' to true
}
else
{
header("Location:index.php"); // Redirect to login page, as a matching record was not found in the table.
exit; // always 'exit'
}
?>
here is what I have on top of the index page, just to make sure that the member has registered correctly (it0s just a little test):
Code:
<?php
session_start();
if ($_SESSION['loggedin'] = 1 )
echo"Welcome back dear member";
else
echo"Welcome. It seems that it is your first visit here";
?>
and here is the error message that I have:
Warning: Cannot send session cookie - headers already sent by (output started at c:\phpdev\www\blog\php\index.php:13) in
c:\phpdev\www\blog\php\index.php on line
14
Warning: Cannot send session cache limiter - headers already sent (output started at c:\phpdev\www\blog\php\index.php:13) in
c:\phpdev\www\blog\php\index.php on line
14
Welcome back dear member
if you can help me that would be lovely.
Bookmarks