<?php include("C:/xampp/htdocs/mySalon/connect_database.php");?>
<?php
if(isset ($_POST ['username']) && $_POST ['password']){
$username = $_POST['username'];
$password=$_POST['password'];
$query=mysql_query("SELECT * FROM admin WHERE username='$username'");
$numrows=mysql_num_rows($query);
if ($numrows!=0)
{
while ($row=mysql_fetch_assoc($query))
{
$dbusername=$row['username'];
$dbpassword=$row['password'];
}
//check to see if they match!
if ($username==$dbusername&& md5 ($password)==$dbpassword)
{
header ('Location: http://localhost/mySalon/admin/admin_page.php');
$_SESSION['username'] = $username;
}
else
echo "Incorrect Password";
}
else
echo "You are not the administrator";
}
else
echo "";
?>
wonderlhily 0 Newbie Poster
diafol
almostbob 866 Retired: passive income ROCKS
decade 2 Junior Poster in Training
cwarn23 387 Occupation: Genius Team Colleague Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.