8d481333
lwadbled
add(html): Codes ...
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
<?php
session_start();
if(isset($_POST['identifiant']) && isset($_POST['mdp'])){
//Connexion à la base de données
$db_user = 'lwadbled';
$db_mdp = 'glopglop';
$db_nom = 'lwadbled';
$db_host = 'localhost';
$db = mysqli_connect($db_host, $db_user, $db_mdp, $db_nom)
or die('could not connect to database');
$identifiant = mysqli_real_escape_string($db,htmlspecialchars($_POST['identifiant']));
$mdp = mysqli_real_escape_string($db,htmlspecialchars($_POST['mdp']));
if($identifiant !=="" && $mdp !== ""){
$requete = "SELECT count(*) FROM utilisateur WHERE
login = '".$identifiant."' AND mdp = '".$mdp."' ";
$exec_requete = mysqli_query($db,$requete);
$reponse = mysqli_fetch_array($exec_requete);
$count = $reponse['count(*)'];
if($count!=0){
$_SESSION['identifiant'] = $identifiant;
echo "<meta http-equiv=\"refresh\" content=\"0;url=menu.php\">";
//header('Location : menu.php');
}else{
echo "<meta http-equiv=\"refresh\" content=\"0;url=index.html\">";
//header('Location : index.html');
}
}else{
echo "<meta http-equiv=\"refresh\" content=\"0;url=index.html\">";
//header('Location : index.html');
}
mysqli_close($db); // Fin de la connexion
}else{
//header('Location : /index.html');
echo "<meta http-equiv=\"refresh\" content=\"0;url=index.html\">";
}
?>
|