0% found this document useful (0 votes)
60 views3 pages

Document 1

This PHP code implements a login page for an employee system. It checks submitted username and password credentials against a database and starts a user session if credentials are valid, redirecting the user to a dashboard. If credentials are invalid, an alert is displayed. The page includes HTML markup for login form fields and styling/layout.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
60 views3 pages

Document 1

This PHP code implements a login page for an employee system. It checks submitted username and password credentials against a database and starts a user session if credentials are valid, redirecting the user to a dashboard. If credentials are invalid, an alert is displayed. The page includes HTML markup for login form fields and styling/layout.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Login

<?php
include "connection.php";
if(isset($_POST["submit1"])){
$res=mysqli_query($link, "select * from admin where email='$_POST[email]' AND pass-
word='$_POST[password]'");
$row2=mysqli_num_rows($res);
$row=mysqli_fetch_array($res);
if ($row2==1){
session_start();
$_SESSION["email"]=$row["email"];
$_SESSION["id"]=$row["id"];
header("Location: admin/dashboard");
}
else{
?>
<script>window.alert("Email and password do not matched!")</script>
<?php
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta content="width=device-width, initial-scale=1, maximum-scale=1, shrink-to-fit=no"
name="viewport">
<title>Login &mdash; Employment System</title>
<link rel="icon" href="logo.png">
<!-- General CSS Files -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/boot-
strap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUO-
hcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.2/css/all.css" in-
tegrity="sha384-fnmOCqbTlWIlj8LyTjo7mOUStjsKC4pOpQbqyi7RrhN7udi9RwhKkMHpvLb-
HG9Sr" crossorigin="anonymous">
<!-- CSS Libraries -->
<link rel="stylesheet" href="node_modules/bootstrap-social/bootstrap-social.css">
<!-- Template CSS -->
<link rel="stylesheet" href="assets/css/style.css">
<link rel="stylesheet" href="assets/css/components.css">
</head>
<body>
<div id="app">
<section class="section">
<div class="d-flex flex-wrap align-items-stretch">
<div class="col-lg-4 col-md-6 col-12 order-lg-1 min-vh-100 order-2 bg-white">
<div class="p-4 m-3">
<img src="logo.png" alt="logo" width="80" class="shadow-light rounded-circle mb-
5 mt-2">
<h4 class="text-dark font-weight-normal"><span class="font-weight-bold">Em-
ployee Login</span></h4>
<p class="text-muted">Before you get started, you must register if you don't al-
ready have an account.</p>
<form method="POST" class="needs-validation" novalidate="">
<div class="form-group">
<label for="email">Email</label>
<input id="email" type="email" class="form-control" name="email"
tabindex="1" required autofocus>
<div class="invalid-feedback">
Please fill in your email
</div>
</div>
<div class="form-group">
<div class="d-block">
<label for="password" class="control-label">Password</label>
</div>
<input id="password" type="password" class="form-control" name="pass-
word" tabindex="2" required>
<div class="invalid-feedback">
Please fill in your password
</div>
</div>
<div class="form-group text-right">

<button type="submit" name="submit1" class="btn btn-primary btn-lg btn-


icon icon-right" tabindex="4">
Login
</button>
</div>

</form>
<?php

?>
<div class="text-center mt-5 text-small">
Copyright &copy; Tricab App IT Solutions OPC
<div class="mt-2">
<a href="https://tricab.blogspot.com/2021/07/privacy-policy.html">Privacy
Policy</a>
<div class="bullet"></div>

</div>
</div>
</div>
</div>
<div class="col-lg-8 col-12 order-lg-2 order-1 min-vh-100 background-walk-y position-
relative overlay-gradient-bottom" data-background="emp.svg">
<div class="absolute-bottom-left index-2">
<div class="text-light p-5 pb-2">
<div class="mb-5 pb-3">
<h1 class="mb-2 display-4 font-weight-bold"></h1>
<h5 class="font-weight-normal text-muted-transparent"></h5>
</div>
<a class="text-light bb" target="_blank" href="#"></a> <a class="text-light bb"
target="_blank" href="#"></a>
</div>
</div>
</div>
</div>
</section>
</div>
<!-- General JS Scripts -->
<script src="https://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLN-
fOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" in-
tegrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIH-
NDz0W1" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"
integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/
nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.nicescroll/3.7.6/jquery.nicescrol-
l.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.24.0/moment.min.js"></script>
<script src="assets/js/stisla.js"></script>
<!-- JS Libraies -->
<!-- Template JS File -->
<script src="assets/js/scripts.js"></script>
<script src="assets/js/custom.js"></script>

<!-- Page Specific JS File -->


</body>
</html>

You might also like