-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathadmin-info-check.php
63 lines (48 loc) · 1.55 KB
/
admin-info-check.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php
require_once "connection.php";
/*
if(isset($_POST['uname'],$_POST['pass']))
{
}
*/
// if(isset())
if(isset($_POST['uname']) && isset($_POST['pass']))
{
session_start();
$email= $_POST['uname'];
$pass= $_POST['pass'];
$query = "select * from sub_admin where Email='$email' and Password='$pass'";
$res = mysqli_query($conn,$query);
if($email == 'admin' & $pass == 'admin@123'){
$_SESSION['email1'] = $_POST['uname'];
$_SESSION['password1'] = $_POST['pass'];
$_SESSION['status1']=true;
header('location:admin/index.php');
}
else if(mysqli_num_rows($res)==1){
//store form username to session
$_SESSION['email']= $_POST['uname'];
$_SESSION['password']= $_POST['pass'];
$_SESSION['status']=true;
//if user found
//redirect to the welcome page
header('location:hamiyestaitwhonibro/index.php');
}
else{
echo '<script type="text/javascript">alert("Invalid login details"); window.location=\'index.php\';</script>';
}
}else{
echo "<script>alert('Please enter username and password to login')</script>";
}
/*
$database_data= mysqli_fetch_assoc($res);
if(count ((array) $database_data)> 0){
header('location: welcome.php' );
}
else{
header('location: index.php');
}
else{
header('location:index.php');
}
*/