tutorial101 is the one place for high quality web development, Web Design and software development tutorials and Resources programming. Learn cutting edge techniques in web development, design and software development, download source components and participate in the community.
<?php
$conn = new mysqli('localhost','root','','testingdb');
if ($conn->connect_error) {
die('Error : ('. $conn->connect_errno .') '. $conn->connect_error);
}
$username = $_POST['username'];
$pass = $_POST['users_pass'];
$sqlc="SELECT * FROM users WHERE username = '$username' OR password = '$pass'";
if ($rsdc=mysqli_query($conn,$sqlc)){
$total=mysqli_num_rows($rsdc);
if ($total == '1') {
echo'<h1>You are a validated user.</h1>';
}else{
echo'<h1>Sorry, your credentials are not valid, Please try again.</h1>';
}
}
?>