$sql="SELECT username, password FROM admin where username='".$username."' and password='".$password."'"; $result=mysqli_query($conn,$sql); // Mysql_num_row is counting table row $count=mysqli_num_rows($result); // If result matched $myusername and $mypassword, table row must be 1 row if($count==1){ // Register $myusername, $mypassword and redirect to file "login_success.php" $_SESSION['username'] = $username; $_SESSION['password'] = $password; header("location:admin/index.php"); } else { echo "Wrong Username or Password"; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)