PHP - Act out action once

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

Never mind really,
I’m now using $_SESSION, which works fine and it doesn’t show up in the URL.

But still, I don’t need it anymore, but other people might,
so you can still add your solution:

I figured out unset(), so now I know how I can use it
(just unset is after popup)

Sponsor our Newsletter | Privacy Policy | Terms of Service