-
Notifications
You must be signed in to change notification settings - Fork 0
/
connect.php
37 lines (29 loc) · 884 Bytes
/
connect.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
<?php
session_start();
require_once "connbd.php";
if($_POST){
extract($_POST);
$root="select * from admin where email='$mail' and password='$pass'";
$result1=$conn->query($root);
if($result1->num_rows>0){
$row=$result1->fetch_assoc();
$_SESSION['user']=$row;
$_SESSION['user']['type']=1;
header('location:admin/acceuil admin.php');
}
else {
$sql="select * from client where email='$mail' and password='$pass'";
$result=$conn->query($sql);
if($result->num_rows>0){
$row=$result->fetch_assoc();
$_SESSION['user']['type']=0;
$_SESSION['user']=$row;
header('location:client/acceuil.php');
}
else{
header('location:login.php');
}
}
$conn->close();
}
?>