Blame view

html/login.php 1.16 KB
8d481333   lwadbled   add(html): Codes ...
1
2
3
  <?php
  session_start();
  if(isset($_POST['identifiant']) && isset($_POST['mdp'])){
9de9bb41   lwadbled   feat(html): Ajout...
4
  	include("connexion.php");
8d481333   lwadbled   add(html): Codes ...
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
  
  	$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{
87d5afd9   lwadbled   feat(*): verifica...
24
  		/* Ne devrait pas pouvoir arriver mais j'ajoute une double sécurité */
8d481333   lwadbled   add(html): Codes ...
25
26
27
28
29
30
31
32
33
34
  		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\">";
  }
  
  ?>