Okay, I have the following.
$username = $_POST['Username'];
$password = $_POST['Password'];
$sql_username_check = mysql_query("SELECT username FROM rpg WHERE username='$username' && password='$password'");
$username_check = mysql_num_rows($sql_username_check);
if($username_check < 1){
die('Invalid Username/Password Combination. Please go <A HREF=login.php>Back</A> And try again.');
}
echo 'Successfully Logged In as ' . $username;
?>
<form method="post" action="cookieme.php">
<input type=hidden name=username value=<? echo $username; ?>>
<input type=hidden name=password value=<? echo $password; ?>>
<Input type=submit value="Continue!">
</FORM>
<?
}
?>
Which seems fine enough.
cookieme.php is the following:
<?
$username = $_POST['username'];
$password = $_POST['password'];
setcookie ("t4cbibleuser", $username);
setcookie ("t4cbiblepass", $password);
?>
and then the 'main2.php', is
<?
include('menu.php');
include('db.php');
$username = $_COOKIE["t4cbibleuser"];
$password = $_COOKIE["t4cbiblepass"];
$sql_username_check = mysql_query("SELECT username FROM rpg WHERE username='$username' && password='$password'");
$username_check = mysql_num_rows($sql_username_check);
if($username_check < 1){
die('You are not logged in! Please go to the <A HREF=login.php>Login Page.</A>');
}
?>
However, if always displayed the 'You are not logged in,' message on Main2.
Ideas?