Re: [SMARTY] Question about sessions

From: Date: Wed, 24 Jul 2002 19:58:22 +0000
Subject: Re: [SMARTY] Question about sessions
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-5424@lists.php.net to get a copy of this message
PHP won't evaluate the second predicate if the first one is false, so using and is safe in this case. Ben On Wednesday, July 24, 2002, at 08:51 , Jim Dam wrote:
I think it probably needs to be this: {if isset($smarty.session.user)}
    {if $smarty.session.user eq 'admin' }
    ..
    {/if}
{/if} ----- Original Message ----- From: "Jan Rosier" <rosier@interstroom.nl> To: <smarty-general@lists.php.net> Sent: Wednesday, July 24, 2002 3:47 PM Subject: Re: [SMARTY] Question about sessions
Maybe this is something for you (I didn't test it ;-) ) {if isset($smarty.session.user) AND $smarty.session.user eq 'admin'} .... {/if} Greetings Jan Rosier ----- Original Message ----- From: "Garland foster" <garland_foster@salutia.com> To: <smarty-general@lists.php.net> Sent: Wednesday, July 24, 2002 8:15 PM Subject: [SMARTY] Question about sessions Hi all, I want to know the best solution to check if a session variable is set, if
I
use {if $smarty.session.user eq 'admin'} Code for admin {else} Code for normal users {/if} Then I have a problem if error_reporting is set to all because the index user cannot be found in the compiled template. Ideas? Thanks, Garland. -- Smarty General Mailing List (http://smarty.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
-- Smarty General Mailing List (http://smarty.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
(q) Ben Godfrey? (a) Developer and Designer, See http://aftnn.org/ for details

« previous php.smarty.general (#5424) next »