Last active
December 19, 2015 22:38
-
-
Save ofus/6028366 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
$dbh = new PDO("mysql:host=localhost;dbname=muratore", "root", ""); | |
$sql = "SELECT count(*) FROM medrithms WHERE username=:username AND contrasena=:contrasena"; | |
$stmt = $dbh->prepare($sql); | |
$stmt->execute(Array(':username' => $_POST['username'], ':contrasena' => $_POST['contrasena'])); | |
$authenticated = $stmt->fetch(PDO::FETCH_COLUMN); | |
if ($authenticated) { | |
echo "BIENVENIDO"; | |
echo $username; | |
} else { | |
echo "USUARIO Y/O CONTRASEÑA INCORRECTO"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment