-
Notifications
You must be signed in to change notification settings - Fork 21
/
login.php
99 lines (91 loc) · 5.2 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<?php
include('includes/connection.php');
?>
<!doctype html>
<html class="no-js" lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>Login</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="apple-touch-icon" href="apple-touch-icon.png">
<!-- Place favicon.ico in the root directory -->
<link href="css/jquery.bxslider.css" rel="stylesheet">
<link href="css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="css/font-awesome.min.css">
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/responsive.css">
<link href='https://fonts.googleapis.com/css?family=Lora:400,400italic,700,700italic' rel='stylesheet' type='text/css'>
<script src="js/vendor/modernizr-2.8.3.min.js"></script>
</head>
<body>
<!--[if lt IE 8]>
<p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
<![endif]-->
<section class="login_area">
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="logo">
<img src="images/logo.png" alt="E-learning">
</div>
<div class="login_form">
<h2 style="text-align:center;margin:20px 0;">Learner's Login</h2>
<form name="form" id="form" class="form-horizontal" enctype="multipart/form-data" method="POST" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-user"></i></span>
<input id="user" type="text" class="form-control" name="user" placeholder="User" required>
</div>
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-key"></i></span>
<input id="password" type="password" class="form-control" name="password" placeholder="Password" required>
</div> <input id="hidden" type="hidden" class="form-control" name="hidden">
<div class="form-group">
<!-- Button -->
<div class="col-sm-12 controls">
<input type="submit" value="Log In" class="btn btn-primary pull-right" name="login"/>
</div>
</div>
<p style="color:#fff;font-size:16px;">New Here?? Sign Up <strong><a href="http://localhost/e-learning/registration.php">Here</a></strong> </p>
</form>
<p style="margin:20px 0;color:#222;text-align:center;font-size:18px;">Go back to the <strong><a href="http://localhost/e-learning/">Site</a></strong> </p>
</div>
</div>
</div>
</div>
</section>
<?php
if(isset($_POST['login'])){
$user = $_POST['user'];
$pass = md5($_POST['password']);
$login_query = "select * from learners where luser_name='$user' AND luser_pass='$pass'";
$run_login = mysqli_query($con,$login_query);
session_start();
if(mysqli_num_rows( $run_login ) > 0 ){
$_SESSION['luser_name'] = $user;
echo "<script>window.open('index.php','_self');</script>";
}
else{
echo "<script>alert('Username Or Password is incorrect !!!');</script>";
}
}
?>
<script src="//code.jquery.com/jquery-1.12.0.min.js"></script>
<script>window.jQuery || document.write('<script src="js/vendor/jquery-1.12.0.min.js"><\/script>')</script>
<script src="js/jquery.bxslider.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/plugins.js"></script>
<script src="js/main.js"></script>
<!-- Google Analytics: change UA-XXXXX-X to be your site's ID. -->
<script>
(function(b,o,i,l,e,r){b.GoogleAnalyticsObject=l;b[l]||(b[l]=
function(){(b[l].q=b[l].q||[]).push(arguments)});b[l].l=+new Date;
e=o.createElement(i);r=o.getElementsByTagName(i)[0];
e.src='https://www.google-analytics.com/analytics.js';
r.parentNode.insertBefore(e,r)}(window,document,'script','ga'));
ga('create','UA-XXXXX-X','auto');ga('send','pageview');
</script>
</body>
</html>