Hello,
I’ve a php script in the top (above ), for logging in,
and if logged in, setting certain variables:
[php]else if($row[‘usr’])
{
// If everything is OK login
$_SESSION['usr']=$row['usr'];
$_SESSION['id'] = $row['id'];
$_SESSION['rememberMe'] = $_POST['rememberMe'];
// Store some data in the session
setcookie('tzRemember',$_POST['rememberMe']);
}
else $err[]='Wrong username and/or password!';
}[/php]
In the bottom (below the ), I’ve this script, showing a popup when logged in:
[php]<?php if($_SESSION['id']): ?>[/php]
<script type="text/javascript">
$(document).ready(function(){
$('#DaltonSWnotfinished').reveal({
animation: 'fadeAndPop',
animationspeed: 600,
closeonbackgroundclick: false,
dismissmodalclass: 'closeDaltonSWnotfinished'
});
});
</script>
[php]<?php endif; ?>[/php]
It works. Each time, your “$_SESSION[‘id’]” is true, it shows the popup.
But your “$_SESSION[‘id’]” is true whenever you’re logged in.
I want something that, when you log in (not when you already are logged in),
it will show the popup. So when you would already be logged in, and you would go to that page, it wouldn’t show up. And of course it shouldn’t show up when you’re not logged in at all.
I tried just using “$justloggedin”, and various other things, but until now, it either
always shows up whenever you’re logged in, or it doesn’t at all.
Maybe I should use loops or something?
Thanks in advance,
Isaiah