Server : LiteSpeed System : Linux nl-srv-web1396.main-hosting.eu 4.18.0-553.83.1.lve.el8.x86_64 #1 SMP Wed Nov 12 10:04:12 UTC 2025 x86_64 User : u107206879 ( 107206879) PHP Version : 7.2.34 Disable Function : NONE Directory : /home/u107206879/domains/escort46.de/public_html/admin_escort46/ |
<?php
include ("db_connection.php"); //Establishing connection with our database
$message = ""; //Variable for storing our errors.
if(isset($_SESSION['adminid']) && isset($_SESSION['is_admin']) && $_SESSION['is_admin']==1){
header("location: /");
}
if(isset($_POST["login"])){
if(empty($_POST["email"]) || empty($_POST["password"])){
$error = "Both fields are required.";
}else{
// Define $username and $password
$username=$_POST['email'];
$password=$_POST['password'];
// To protect from MySQL injection
$username = stripslashes($username);
$password = stripslashes($password);
$username = mysqli_real_escape_string($connection, $username);
$password = mysqli_real_escape_string($connection, $password);
//Check username and password from database
$sql="SELECT * FROM adminpanel WHERE email='$username' and password='$password'";
$result=mysqli_query($connection,$sql);
$row=mysqli_fetch_array($result,MYSQLI_ASSOC);
//If username and password exist in our database then create a session.
//Otherwise echo error.
if(mysqli_num_rows($result) == 1){
$_SESSION['adminid'] = $row['id'];
$_SESSION['adminemail'] = $row['email'];
$_SESSION['uname'] = $row['uname'];
$_SESSION['is_admin'] = $row['is_admin'];
$_SESSION['user_type'] = 'Admin';
header("location: index"); // Redirecting To Other Page
}else{
$message = "Incorrect username or password.";
}
}
}
?>
<html lang="en">
<head>
<?php include_once "head.php"; ?>
</head>
<style>
#login{
margin: 50px;
}
</style>
<body id="myPage" data-spy="scroll" data-target=".navbar" data-offset="60">
<?php /*include_once "navbar.php";*/ ?>
<div class="container-fluid">
<section id="login">
<div class="container">
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-4 col-lg-4 signin">
<div class="form-wrap">
<?php
if($success != ""){
echo $success;
}
?>
<center>
<h2 class="h2_tag">Login</h2>
<hr class="hr_lines">
<h3 class="h3_tag" style="margin-bottom: 40px;">Use your registered email id to login</h3>
</center>
<div class="error-message" style="margin-bottom: 10px;"><?php if(isset($message)) { echo $message; } ?></div>
<form role="form" action="" method="post" id="login-form" autocomplete="off">
<div class="form-group">
<label for="email" class="sr-only">Email</label>
<input type="email" name="email" id="email" class="form-control" placeholder="[email protected]" required>
</div>
<div class="form-group">
<label for="password" class="sr-only">Password</label>
<input type="password" name="password" id="password" class="form-control" placeholder="Password" required>
</div>
<input type="submit" name="login" id="btn-login" class="btn btn-custom btn-lg btn-block" value="Log in">
</form>
</div>
</div>
</div>
</div>
</section>
</div>
</body>
</html>