i have one php function which verify admin login like that
if($vAdmin==1)
{
$_SESSION['admin']="admin";
header("location:index.php");
}
else
{
$errMsg="Invalid Username or Password.";
}
This work perfect but i want to show the div which show the error message, so i defined the div like this and its hidden div in style.
<div class="notification">Invalid username or password. (Type anything)</div>
i have changed the above function to
if($vAdmin==1)
{
$_SESSION['admin']="admin";
header("location:index.php");
}
else
{?>
$('div.notification').fadeIn();
setTimeout(function() {
$('div.notification').fadeOut('slow');
}, 3000);
<?}
?>
my basic purpose is when its not verified just show the div and hide it.
but its not working?
Thanks
Change the else part of your code to the following:
I’m also assuming you’re including the jQuery library somewhere prior to where this script tag is added. If you’re not, make sure you do.