<?php
ob_start();
require 'connection.php';
session_start();
if(isset( $_POST['submit1'] ) )
{
$email = mysqli_real_escape_string($con, $_POST['email']);
//$email1 = $_GET['email']);
$password = mysqli_real_escape_string($con, $_POST['password']);
//$password1 = $_GET['password']);
$result = mysqli_real_escape_string($con, $_POST['result']);
$sql = "SELECT * FROM admin where email='".$email."' and password='".$password."' ";
$result = mysqli_query($con, $sql);
if (mysqli_num_rows($result) > 0)
{
$_SESSION['a_loggedin'] = true;
$_SESSION['a_email'] = $email;
//header("Location:a_dashboard.php");
header("Location:a_dashboard.php");
}
else
{
header("Location:a_loginform.php");
}
}
?>
<form name="form" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>" method="post">
<span style="color:red; margin-left:-13px;">*</style></span> <input type="email" name="email" placeholder="Email" id="formTemplate" required/>
<? if($err1!=""){ echo $err1; }?>
<span style="color:red; margin-left:-13px;">*</style></span><input type="password" name="password" placeholder="Password" required/>
<input type="hidden" name="result" value="<? echo $_SESSION["result"];?>">
<button name="submit1">Login</button>
</form>
ob_start();
require 'connection.php';
session_start();
if(isset( $_POST['submit1'] ) )
{
$email = mysqli_real_escape_string($con, $_POST['email']);
//$email1 = $_GET['email']);
$password = mysqli_real_escape_string($con, $_POST['password']);
//$password1 = $_GET['password']);
$result = mysqli_real_escape_string($con, $_POST['result']);
$sql = "SELECT * FROM admin where email='".$email."' and password='".$password."' ";
$result = mysqli_query($con, $sql);
if (mysqli_num_rows($result) > 0)
{
$_SESSION['a_loggedin'] = true;
$_SESSION['a_email'] = $email;
//header("Location:a_dashboard.php");
header("Location:a_dashboard.php");
}
else
{
header("Location:a_loginform.php");
}
}
?>
<form name="form" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>" method="post">
<span style="color:red; margin-left:-13px;">*</style></span> <input type="email" name="email" placeholder="Email" id="formTemplate" required/>
<? if($err1!=""){ echo $err1; }?>
<span style="color:red; margin-left:-13px;">*</style></span><input type="password" name="password" placeholder="Password" required/>
<input type="hidden" name="result" value="<? echo $_SESSION["result"];?>">
<button name="submit1">Login</button>
</form>
No comments:
Post a Comment