-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Big Bug
committed
Feb 16, 2019
1 parent
db5a7dc
commit ac14c18
Showing
4 changed files
with
105 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
|
||
<!-- head --> | ||
<?php include_once"templating/head.php" ?> | ||
|
||
<!-- Navigation --> | ||
<?php include_once"templating/main_nav.php" ?> | ||
|
||
|
||
<!-- Page Content --> | ||
<div class="container"> | ||
|
||
<div class="row justify-content-center"> | ||
|
||
<div class="col-lg-6 bg-dark text-light pb-5 pt-5"> | ||
<!-- < ?php if(isset($_GET['name'])){ ?> --> | ||
<form action="php/loginChecker.php" method="post"> | ||
<legend class="text-center text-uppercase">User Login</legend> | ||
|
||
<div class="form-group"> | ||
<label for="email">Email :</label> | ||
<input type="email" name="email" id="email" class="form-control" placeholder="Example: [email protected]"> | ||
</div> | ||
|
||
<div class="form-group"> | ||
<label for="pass">Password :</label> | ||
<input type="password" name="pass" id="pass" class="form-control" placeholder="******"> | ||
</div> | ||
|
||
<div class="form-group"> | ||
<input type="submit" class="form-control btn btn-success mt-4" value="SUBMIT"> | ||
</div> | ||
<p class="h4 text-center"><?php if (isset($_SESSION['msg'])) { | ||
echo($_SESSION['msg']); | ||
unset($_SESSION['msg']); | ||
} ?></p> | ||
</form> | ||
|
||
<!-- < ?php }?> --> | ||
|
||
</div> | ||
|
||
</div> | ||
<!-- /.row --> | ||
|
||
</div> | ||
<!-- /.container --> | ||
|
||
<!-- Footer --> | ||
<?php include_once"templating/footer_area.php" ?> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
|
||
|
||
<?php | ||
session_start(); | ||
if ($_POST) { | ||
$email = $_POST['email']; | ||
$pass = $_POST['pass']; | ||
|
||
if (empty($email)) { | ||
$_SESSION['msg'] = "Please enter valid email address"; | ||
}elseif (empty($pass)) { | ||
$_SESSION['msg'] = "Please enter your password"; | ||
}else{ | ||
|
||
include_once "DB/DB_Connection.php"; | ||
$conn = DataBaseConnection(); | ||
|
||
$sql = "SELECT * FROM users WHERE email ='$email' AND pass = '$pass' "; | ||
if($result = $conn->query($sql)){ | ||
foreach($result AS $row){ | ||
$_SESSION['userName'] = $row['name']; | ||
} | ||
$_SESSION['loggedIn'] = true; | ||
$_SESSION['msg'] = "You are successfully Logged In"; | ||
}else{ | ||
$_SESSION['msg'] = "Invalid Username or Password"; | ||
} | ||
} | ||
header("location:../login.php"); | ||
|
||
} | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?php | ||
session_start(); | ||
unset($_SESSION['loggedIn']); | ||
header("location:../login.php"); | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters