-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathauthenticate2.php
More file actions
51 lines (43 loc) · 959 Bytes
/
authenticate2.php
File metadata and controls
51 lines (43 loc) · 959 Bytes
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
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<?php
$message=0;
if(count($_POST)>0) {
echo "ppppp";
$hostname = "localhost";
$username = "root";
$password = "";
$con = mysql_connect($hostname, $username, $password) ;
if (!$con){ die('Could not connect: '. mysql_error());}
$dbName="delhimetro";
$db = mysql_select_db($dbName,$con);
$a=$_POST["adminid"];
$sql = "SELECT * FROM admin WHERE admin_id=$a";
$result=mysql_query($sql);
$row =mysql_fetch_array($result);
//echo($_POST['password']);
$res=$row['password'];
if($res!=$_POST['password']) {
echo "<script>window.location.href = 'adminlogin.php';</script>";
} else {
echo "<script>window.location.href = 'admininterface.php';</script>";
}
}
?>
<script>
var s=<?php echo $message?>;
console.log(s);
/*if(s){
window.location.href = "admininterface.php";
}
else{
window.location.href = "adminlogin.php";
alert("error");
}*/
</script>
</body>
</html>