<?php
session_start();
include("config.php"); // or connection here
?>
<?php
if(isset($_POST['btn_login']))
{
$query="select * from admin_login where email='".$_POST['email']."' and password='".$_POST['password']."' ";
$res=mysqli_query($con,$query) or die(mysql_error($con));
if(mysqli_num_rows($res)>0)
{
$row=mysqli_fetch_array($res);
extract($row);
//session_start();
$_SESSION['id']=$row['id'];
$_SESSION['email']=$row['email'];
echo "<script>";
echo "alert('Login Successfully');";
echo "window.location.href='home.php';";
echo "</script>";
}
else
{
echo "<script>";
echo "alert('Email or Password is Invalid');";
echo "window.location.href='index.php';";
echo "</script>";
}
}
?>
session_start();
include("config.php"); // or connection here
?>
<?php
if(isset($_POST['btn_login']))
{
$query="select * from admin_login where email='".$_POST['email']."' and password='".$_POST['password']."' ";
$res=mysqli_query($con,$query) or die(mysql_error($con));
if(mysqli_num_rows($res)>0)
{
$row=mysqli_fetch_array($res);
extract($row);
//session_start();
$_SESSION['id']=$row['id'];
$_SESSION['email']=$row['email'];
echo "<script>";
echo "alert('Login Successfully');";
echo "window.location.href='home.php';";
echo "</script>";
}
else
{
echo "<script>";
echo "alert('Email or Password is Invalid');";
echo "window.location.href='index.php';";
echo "</script>";
}
}
?>
ConversionConversion EmoticonEmoticon