in database i have added the random and activated with boolean type and the defaul was set to As defined with 0 value.when i click log in it must desplay this: your accoun si not activate.Please check your email.
but i show you are in click here to click here to enter in member page,any solutin from you??plzz help
session_start();
$username =@$_POST['username'];
$password =@$_POST['password'] ;
if($username&&$password)
{
$connect = mysql_connect("localhost","root","") or ("Couldn't connect!");
mysql_select_db("phplogin") or die ("Couldn't find db");
$query = mysql_query("Select * FROM users WHERE username='$username'");
$numrow= mysql_num_rows($query);
if ($numrow!=0)
{
while($row = mysql_fetch_assoc($query))
{
$dbusername = @$row['username'];
$dbpassword = @$row['password'];
$acivated = $row=['activated'];
if(@$activated=='0')
{
die("your accoun si not activate.Please check your email!");
exit();
}
}
// check to see if they match
if($username==$dbusername&&md5($password)==$dbpassword)
{
echo("You are in!<a href='member.php'>Click</a>here to enter in member page.");
@$_SESSION['username']=$username;
}
else
echo ("Incorrect password!");
}
else
die ("That user doesn't exist!");
}
else
echo ("Please enter a username and a password!");
?>