-
Notifications
You must be signed in to change notification settings - Fork 0
/
login.php
62 lines (62 loc) · 1.86 KB
/
login.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
<?php
include "dbconnection.php";
error_reporting(0);
if(strlen($_POST["confirmpass"])>0)
{
$pass=$_POST["newpass"];
$mob=$_SESSION['mobile'];
$stmt=$conn->prepare("UPDATE users SET password='".$pass."' where mobile='".$mob."'");
$stmt->execute();
$stmt->close();
}
else if(isset($_POST["newuser"]))
{
$user=$_POST["newuser"];
$mob=$_SESSION['mobile'];
$stmt=$conn->prepare("UPDATE users SET username='".$user."' where mobile='".$mob."'");
$stmt->execute();
$stmt->close();
}
session_destroy();
?>
<!doctype html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="login.css">
<title>Gossip - Login</title>
<script src="http://use.edgefonts.net/montserrat:n4:default;source-sans-pro:n2:default.js" type="text/javascript"></script>
</head>
<body>
<center><div class="login_form">
<section class="login-wrapper">
<div class="logo">
<img class="lo" src="logo.png">
</div>
<div class="fo">
<form id="login" method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>">
<label for="mobile">Mobile Number</label>
<input required name="mobile" type="number" autocapitalize="off" autocorrect="off"/>
<label for="password">Password</label>
<input class="password" id="password" required name="password" type="password" />
<div class="hide-show" onClick="show()">
<span>Show</span>
</div>
<br>
<br>
<p id="invalid"></p>
<br>
<label class="reg" for="sub">Not Registered? <a href="registration.php">Create an account</a></label>
<button class="sub" type="submit">Sign In</button>
</form>
</div>
</section>
</div></center>
</body>
<div id="verify">
<?php
include "logdb.php";
?>
</div>
<script type="text/javascript" src="log.js"></script>
</html>