Project Work and Coding
Project Work and Coding
Project Work and Coding
php
include("db.php");
session_start();
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$email = $_POST['email'];
$password = $_POST['password'];
$result = $conn->query($sql);
if ($result->num_rows > 0) {
$row = $result->fetch_assoc();
// echo $row;
$username = $row['username'];
$_SESSION['username'] = $username;
// Redirect to index.php
header("Location: index.php");
exit;
} else {
$conn->close();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Attendance App</title>
<link
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootst
rap.min.css" rel="stylesheet" integrity="sha384-
QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6h
W+ALEwIH" crossorigin="anonymous">
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/css/toas
tr.min.css">
<style>
*{
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
.card{
margin-left: 25%;
margin-top: 8%;
.buttons {
margin: 10%;
text-align: center;
.btn-hover {
width: 200px;
font-size: 16px;
font-weight: 600;
color: #fff;
cursor: pointer;
height: 55px;
text-align:center;
border: none;
border-radius: 10px;
.btn-hover:hover {
background-position: 100% 0;
.btn-hover:focus {
outline: none;
.btn-hover.color-1 {
</style>
</head>
<body class="bg-dark">
<div class="row">
<div>img=th.jpg</div>
<?php
if(isset($_GET['status']) && $_GET['status'] == 'success') {
?>
<label class="form-label"
for="form2Example2">Email</label>
</div>
<label class="form-label"
for="form2Example2">Password</label>
</div>
<p>
</p>
</form>
</div>
</div>
</div>
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script
src="http://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/js/toastr.
min.js"></script>
</body>
</html>
<?php
session_start();
$_SESSION = array();
session_destroy();
header("Location: login.php");
exit;
?>