-
Notifications
You must be signed in to change notification settings - Fork 0
/
identification.php
49 lines (42 loc) · 1.45 KB
/
identification.php
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Bienvenu au !|E-commerce</title>
</head>
<body>
<?php
include("menu.php");
function verifier ($login, $motPasse){
if(strlen(trim($login))==0 || strlen(trim($motPasse))==0)
return "Vous devez remplir tous les champs du formulaire !!!";
else{
//tester si le login spécifié est déja utilisé
require_once("connexion.php");
$res = mysql_query("select * from administrateur where login like '$login' and pass like '$motPasse'");
//echo ("select * from adherent where login like '$login'");
//echo $res;
if(mysql_num_rows($res)==0)
return "Vous n'etes pas administrateur de cette application !!!!";
}
return "true";
}
//onsubmit="return tester()"
echo '<table width="800" border="0" align="center"><tr><td>';
$login = $_POST['login'];
$motPasse = $_POST['pass'];
$msg = verifier($login, $motPasse);
if(strcmp($msg, "true") != 0){
echo $msg;
echo "<br/>Cliquer <a href=\"formidentification.php\">ici</a> pour revenir au formulaire....";
}
else {
$_SESSION['admin'] = true;
echo "<br/>Bienvenu:<font color='orange'>".$login."</font>";
echo '<br/> si vous voulez actualiser la connection cliquer :<a href="index.php">ici</a>';
}
?>
</td></tr>
</table>
</body>
</html>