Created
February 10, 2017 19:47
-
-
Save KOUISAmine/1ac0f65e4f2c8ec4b381e65bbbc0b8c2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once 'connect.php'; | |
$username = $_POST['username']; | |
$password = $_POST['password']; | |
$stmt = $conn->prepare("SELECT * FROM `user` WHERE username = '$username' && `password` = '$password'") or die(mysqli_error()); | |
if($stmt->execute()){ | |
$result = $stmt->get_result(); | |
$num_rows = $result->num_rows; | |
} | |
if($num_rows > 0){ | |
echo "Success"; | |
}else{ | |
echo "Error"; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment