");
}else{
// On va vérifier les variables
print("Verification du login et pass
");
if(!preg_match('/^[[:alnum:]]+$/', $_GET['login']) or
!preg_match('/^[[:alnum:]]+$/', $_GET['motdepasse']))
{
echo 'Vous devez entrer uniquement des lettres ou des chiffres
';
echo 'Ressayer';
exit();
}
}
*/
$sql_host = "localhost";
$sql_user = "iut";
$sql_pwd = "iut";
$sql_db = "BD_TP2";
// Create connection
$conn = new mysqli($sql_host, $sql_user, $sql_pwd, $sql_db);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
echo "
"."Connexion reussie :)..."."
";
$nom = $_GET['login'];
$motdepasse = $_GET['motdepasse'];
print ("nom = $nom, mdp = $motdepasse");
echo "
New record created successfully";
/*
//select des cartes
// on envoie la requête
$sql ="SELECT numerocarte FROM comptes WHERE (nom = '$nom' AND motdepasse = '$m$
$req = $conn->query($sql) or die('Erreur SQL !
'.$sql.'
'.mysql_error());
$row = $req->fetch_assoc();
echo "
";
echo "numero de carte = ";
echo $row['numerocarte'];
//Fermeture de la connexion
$conn->close();
*/
?>