-
Notifications
You must be signed in to change notification settings - Fork 1
/
userlogin.php
73 lines (55 loc) · 1.55 KB
/
userlogin.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
<?php session_start(); ?>
<?php
include_once "connection/conn.php";
?>
<!DOCTYPE html>
<html>
<title>User Login</title>
<link rel="stylesheet" type="text/css" href="common/css/login.css">
<style type="text/css">
.bs-example {
margin:10px;
}
body {
background: url("common/images/");
background-position: center 0;
backface-visibility: visible;
background-color: #ffff!important;
background-repeat: no-repeat;
}
</style>
</head>
<body>
<div class="container" style="margin-top:40px; color: red;">
</div>
<div style="width: 200px;height: 50px;margin:0 auto;color: red;">
</div>
<section class="loginpage clear">
<?php
if ($_SERVER["REQUEST_METHOD"]=="POST") {
$phone=$_POST["phone"];
$sql="SELECT * FROM book where phone='$phone'";
$query=mysqli_query($connection,$sql);
if ($query !=false) {
$num=mysqli_num_rows($query);
if ($num>0) {
$value=mysqli_fetch_array($query);
$_SESSION["usession"]=true;
$_SESSION["book_id"]=$value["book_id"];
header("Location:massuser.php");
}
}
}
?>
<form action="" method="post">
<h2>Login Page</h2>
<div>
<label>Phone</label>
<input type="text" name="phone" placeholder="Phone"/>
</div>
<input type="submit" name="submit" value="Login"/>
</div>
</form>
</section>
</body>
</html>