-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprocess.php
More file actions
62 lines (56 loc) · 1.63 KB
/
Copy pathprocess.php
File metadata and controls
62 lines (56 loc) · 1.63 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
<?php
$username=$_POST['username'];
$password=$_POST['password'];
$c=mysqli_connect("localhost","root","");
session_start();
$username=stripcslashes($username);
$password=stripcslashes($password);
$username=mysqli_real_escape_string($c,$username);
$password=mysqli_real_escape_string($c,$password);
mysqli_select_db($c,"d_bankingsystem");
if(isset($username) && isset($password)){
if(empty($username)){
header("Location:index.php?error=USER NAME NOT ENTERED");
exit();
}else if(empty($password)){
header("Location:index.php?error=PASSWORD NOT ENTERED");
exit();
}else{
$result=mysqli_query($c,"select * from d_users where user_Id='$username' and Password='$password' ")
or die("failed to query database".mysqli_error($c));
$row1=mysqli_fetch_array($result);
if(mysqli_num_rows($result))
{
$_SESSION['user_id']=$row1['user_Id'];
$query="select * from d_ur where user_Id='".$username."'";
$result=mysqli_query($c,$query);
if($result=mysqli_fetch_assoc($result))
{
header("location:main.php");
}
else
{
$query="select * from v_admin_ur where v_admin_user_id='".$_POST['username']."'";
$result=mysqli_query($c,$query);
if($result=mysqli_fetch_assoc($result))
{
header("location:adminhome.php");
}
else
{
header("location:noroleman.php");
}
}
}
else
{
header("Location:index.php?error=USER NAME OR PASSWORD IS INVALID");
exit();
}
}
}
else{
header("Location:index.php?error=PLEASE ENTER BOTH USER NAME AND PASSWORD");
exit();
}
?>