-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvalidate_admin.php
More file actions
42 lines (42 loc) · 1.04 KB
/
validate_admin.php
File metadata and controls
42 lines (42 loc) · 1.04 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
<?php
ob_start();
session_start();
echo "started";
include("connection.php");
$id=$_POST['uname'];
$pwd=$_POST['password'];
$table_name="login";
echo $id;
if($id !="" || $pwd !=""){
$sql="SELECT * FROM `login` WHERE userid=$id";
$result = mysql_query($sql);
$row = mysql_fetch_array($result);
$name=$row['userid'];
$password=$row['password'];
echo $pwd;
if(!($id || $_POST['pwd']))
{
echo "user name or password wrong could not sign in";
}
if($password!=$_POST['pwd'])
{
echo $_POST['pwd'];
echo "password not right";
echo $password;
//header("Location: http://localhost/ourweb/index_error.php");
exit;
}
if($password==$_POST['pwd'])
{
echo 'success';
$_SESSION['uname']=$id;
$_SESSION['priv'] = 1;
header("Location: http://localhost/bootstrap/admin_queries.php");
}
else
{
echo 'enter password';
}
ob_flush();}
else{header("Location: http://localhost/bootstrap/admin_login.php"); }
?>