-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex1.php
76 lines (65 loc) · 1.71 KB
/
index1.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
64
65
66
67
68
69
70
71
72
73
74
75
76
<?php
session_start();
include_once 'connect.php';
if(isset($_SESSION['user'])!="")
{
header("Location: choice.php");
}
if(isset($_POST['btn-login']))
{
$email = mysqli_real_escape_string($con, $_POST['email']);
$upass = mysqli_real_escape_string($con, $_POST['pass']);
$res=mysqli_query($con, "SELECT * FROM users WHERE email='$email'");
$row=mysqli_fetch_array($res);
if($row['password']==md5($upass))
{
$_SESSION['user'] = $row['user_id'];
header("Location: choice.php");
}
else
{
$err = "<p style='color: red'>Wrong Username or Password</p>";
?>
<?php
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Droids</title>
<link rel="stylesheet" href="style.css" type="text/css" />
</head>
<body>
<center>
<div id="login-form">
<form method="post">
<table align="center" width="30%" border="0" >
<tr>
<?php echo @$err;?>
<td> <h1>HACKJINI</h1><br> <input type="text" name="email" placeholder="Your Email" required /></td>
</tr>
<tr>
<td><input type="password" name="pass" placeholder="Your Password" required /></td>
</tr>
<tr>
<td>
<label class="custom-file-upload">
<input type="file"/>
<i class="fa fa-cloud-upload"></i> Upload Identity Proof
</label>
</td>
</tr>
<tr>
<td><button type="submit" name="btn-login">Sign In</button></td>
</tr>
<tr>
<td><a href="register.php">Sign Up Here</a></td>
</tr>
</table>
</form>
</div>
</center>
</body>
</html>