-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathauthenticate4.php
More file actions
39 lines (33 loc) · 864 Bytes
/
authenticate4.php
File metadata and controls
39 lines (33 loc) · 864 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
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<?php
$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["userid"];
$sql = "SELECT * FROM user WHERE user_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 = 'user.php';</script>";
}
?>
<form name="lll" action="showdetails.php" method="POST">
<input type="text" name="userid" value=<?php echo $_POST['userid']?>>
<input type="submit" name="" value="submit">
</form>
<script type="text/javascript">
document.forms['lll'].submit();
</script>
</body>
</html>