-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSeconnecter.php
More file actions
58 lines (39 loc) · 1.64 KB
/
Seconnecter.php
File metadata and controls
58 lines (39 loc) · 1.64 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php // Ce formulaire, cest pour se connecter pour ceux qui ont un compte?>
<?php Include "header.php";?>
<?php
if(isset($_POST['submit'])) {
$password = $_POST['password'];
$email = $_POST['email'];
// The connexion root variable is created.
$connection = mysqli_connect("localhost","root","","php_project");
// If The connexion is established or not.
if (!$connection)
{
echo"<h3 class='h5'> Sorry, Database is currently inaccessible .</h3>";
}
else
{
// Requete descente des inscrits pour Verification des credentials
$result = mysqli_query($connection, "SELECT * FROM users;");
# Die if connection net established
if(!$result){
die(mysqli_error($connection));
}
# Check if result greater then 0
if (mysqli_num_rows($result) > 0){
$count=0;
while($rowData = mysqli_fetch_assoc($result)){
$count= $count + (in_array($email, $rowData, $strict = false) && in_array($password, $rowData, $strict = false));
}
if ($count) {
echo "<h3 class='h4'> Bienvenu (e)! <h3>", $email;
echo " <h3 class='h4'>Vous etes connecté avec succès....<h3>";
}
else
{
echo" <h3 class='h4'>Connexion rejetée. <br> Vérifier votre saisie, ou Inscrivrez-vous, si vous ne l'êtes pas encore. ..<h3>";
}
}
}
}
?>