-
Notifications
You must be signed in to change notification settings - Fork 1
/
login4.php
72 lines (65 loc) · 2.03 KB
/
login4.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
<?php
include_once('db.php');
session_start();
if(isset($_SESSION['chem_user']))
{
header('location:index.php');
}
$status="If login or registration problem persists contact [email protected]";
$statu="";
if(isset($_POST['username'])&&($_POST['password'])){
$userid=htmlspecialchars(addslashes(mysqli_real_escape_string($con,$_POST['username'])));
$password=htmlspecialchars(addslashes(mysqli_real_escape_string($con,$_POST['password'])));
$query=mysqli_query($con,"SELECT id, password FROM chemical.users WHERE id='".$userid."' and password='".$password."'");
$c=mysqli_num_rows($query);
if($c>=1)
{
$_SESSION['chem_user']=$userid;
header("Location:index.php");
}
else
{
$statu="OOPS...,INVALID DETAILS.";
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Login</title>
</head>
<body id="auth-page">
<h1 align='center' style="color:green;"><?php echo $status; ?></h1>
<div id="page-body-auth">
<div id="wrapperbg-auth">
<h1 align='center' style="color:green;"><?php echo $statu; ?></h1>
<div id="container-auth">
<header>Login</header>
<div class="content">
<form class="form" id="loginform" method="post" action="">
<div class="line">
<label>Username:</label>
<input type="text" class="text full96" id="username" name="username" required=""/>
</div>
<div class="line">
<label>Password:</label>
<input type="password" class="text full96" id="password" name="password" required=""/>
<label> <a href="forgotpass" class="small bold float-right">Forgot password?</a></label>
</div>
<div class="line">
<input type="checkbox" id="remember" class="" value="1" name="remember"/>
<label class="choice" for="remember">Remember me</label>
<button type="submit" class="submitbtn" name="submit">Login</button>
<div class="clearfix"></div>
</div>
</form>
<div class="clearfix"></div>
</div>
</form>
</div>
</div>
</div>
</div>
</body>
</html>