-
Notifications
You must be signed in to change notification settings - Fork 1
/
header.php
executable file
·66 lines (58 loc) · 2.3 KB
/
header.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
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="sweetalert-master/lib/sweet-alert.css">
<script src="sweetalert-master/lib/sweet-alert.min.js"></script>
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
</head>
<body>
<nav class="navbar navbar-fixed-top navbar-inverse">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar"
aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="home.php">APP { ON-THE-FLY }</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<form class="navbar-form navbar-right" method="post">
<div class="form-group">
<input type="email" name="email" placeholder="Email" class="form-control" required>
</div>
<div class="form-group">
<input type="password" name="pass" placeholder="Password" class="form-control" required>
</div>
<button type="submit" name="login" class="btn btn-success">Sign in</button>
<a href="registration.php" name="signup" class="btn btn-success">Sign up</a>
</form>
</div>
<!--/.navbar-collapse -->
</div>
</nav>
</body>
</html>
<?php
include("database/db_conection.php");
if (isset($_POST['login'])) {
$user_email = $_POST['email'];
$user_pass = $_POST['pass'];
$check_user = "select * from users WHERE email='$user_email'AND password='$user_pass'";
$run = mysqli_query($dbcon, $check_user);
if (mysqli_num_rows($run)) {
session_start();
echo "<script>window.open('welcome.php','_self')</script>";
$_SESSION['email'] = $user_email;//here session is used and value of $user_email store in $_SESSION.
} else {
?>
<script type='text/javascript'>
swal("Oops...!", "User name or Password is wrong. Try again !.", "error");
</script>
<?php
}
}
?>