-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconnectionas.php
More file actions
63 lines (62 loc) · 1.79 KB
/
Copy pathconnectionas.php
File metadata and controls
63 lines (62 loc) · 1.79 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
58
59
60
61
62
63
<?php
session_start();
$bdd = new PDO('mysql:host=127.0.0.1;dbname=Test1', 'root', '');
if(isset($_POST['ok'])) {
$nomcli = htmlspecialchars($_POST['login']);
$mdpconnect = htmlspecialchars($_POST['pass']);
if(!empty($nomcli) AND !empty($mdpconnect)) {
$requser = $bdd->prepare("SELECT * FROM clients WHERE NomCli = ? AND CodeCli = ?");
$requser->execute(array($nomcli, $mdpconnect));
$userexist = $requser->rowCount();
if($userexist == 1) {
$userinfo = $requser->fetch();
$_SESSION['nomcli'] = $userinfo['nomcli'];
$_SESSION['mdpconnect'] = $userinfo['mdpconnect'];
header("Location: page2.html");
} else {
$erreur = "Mauvais nomclient ou mot de passe !";
}
} else {
$erreur = "Tous les champs doivent être complétés !";
}
}
?>
<html>
<head>
<title>Accueil</title>
</head>
<link rel = "stylesheet" href = "styl.css" media=" screen " type ="text/css" />
<body>
<marquee>
<h1>Bienvenue sur la page de Ouria Marie Diaham Et Brahim Elmoctar </h1>
</marquee>
<center>
<fieldset style= "background-color : #808080; width: 400px;">
<h3> Identifier vous S.V.P : </h3> <br />
</fieldset>
<form method="post" action="">
<fieldset style= "background-color : #808080; width: 400px;">
<table>
<tr>
<td>Login : </td>
<td> <input type="text" name="login" > </td>
</tr>
<tr>
<td>Mot de passe : </td>
<td><input type="password" name="pass" > </td>
</tr>
<tr>
<td><input type="Submit" name="ok" value="Ok"> </td>
<td><input type="Reset" name="Annuler" value="Annuler"> </td>
</tr>
</table>
</form>
</center>
<?php
if(isset($erreur)) {
echo '<font color="red">'.$erreur."</font>";
}
?>
</body>
</fieldset>
</html>