Code: Select all
$username = $_POSTї'loginusername'];
$password = $_POSTї'loginpassword'];
$password = md5($password);
$logincheck=mysql_query("SELECT * FROM users WHERE username='$username' AND password='$password'");
$logincheck2 = mysql_num_rows($logincheck);
while($row = mysql_fetch_array($logincheck))
{
$username = $rowї'username'];
$age = $rowї'age'];
$email = $rowї'email'];
$fname = $rowї'fname'];
$registrydate = $rowї'registrydate'];
$gender = $rowї'gender'];
$country = $rowї'country'];
$civilization = $rowї'civilization'];
}
$_SESSIONї'username'] = $username;
$_SESSIONї'email'] = $email;
$_SESSIONї'fname'] = $fname;
$_SESSIONї'registrydate'] = $registrydate;
$_SESSIONї'gender'] = $gender;
$_SESSIONї'country'] = $country;
$_SESSIONї'age'] = $age;
$_SESSIONї'civilization'] = $civilization;
if($logincheck2 == 1)
{
echo "You are now logged in as: $_sessionїusername]";
}
else
{
echo "You couldn't be logged in. Please try again!";
die;
}
if($_sessionї'civilization'] == admin)
{
echo 'To go to the admin hompage <a href="sbadmin.php">Click Here</a>!';
}
elseif($_sessionї'civilization'] == human)
{
echo 'To go to the human hompage <a href="humans/">Click Here</a>!';
}
elseif($_sessionї'civilization'] == alien)
{
echo 'To go to the aliens hompage <a href="aliens/">Click Here</a>!';
}
?>