Code: Select all
if (isset($_COOKIE['username'])) {
$username = $_COOKIE['username'];
}
else {
header('Location: index.php?content=login'); }
if (isset($_COOKIE['password'])) {
$password = $_COOKIE['password'];}
else {
header('Location: index.php?content=login'); }
$getpassq = mysql_query("SELECT User_pass FROM aero_users WHERE User_name = '$username'");
$getpassa = mysql_fetch_assoc($getpassq);
$getpass = $getpassa['User_pass'];
if ($getpass != $password) {
header ('Location: index.php?content=login'); }
}Later in the script though, where I use $username to retrieve information from the database, it errors me and says the variable hasn't been set.
Specifically, there are 3 occasions, with this being the first of them-
Code: Select all
$getmsg = mysql_query ("SELECT * FROM aero_mail WHERE Message_Recipient = '$username' AND Message_New = '1'");