smarty php

Discussion in 'Templates customization' started by CrackBaby, Oct 29, 2010.

  1. CrackBaby

    CrackBaby Member

    Joined:
    Aug 22, 2006
    Messages:
    154
    I used to use

    {php}
    if ($au=$_SESSION['_amember_user']){ // user is logged-in

    echo "<div> Welcome $au[name_f] $au[name_l]</div>";

    } else { // user is not logged-in

    echo "<div>Please Login</div>";

    }
    {/php}

    I switch to 3.2.3 and every time I add the $au[name_f] $au[name_l] or $au=$_SESSION['_amember_user']

    I get a blank white page

    any ideas?
  2. CrackBaby

    CrackBaby Member

    Joined:
    Aug 22, 2006
    Messages:
    154
    I dont know how I fixed it but I did. Must have missed something somewhere.
  3. CrackBaby

    CrackBaby Member

    Joined:
    Aug 22, 2006
    Messages:
    154
    Ok I figured out what I was doing wrong

    I forgot to include

    Code:
    session_start(); 
    so it should look like this:

    Code:
    
    {php}
    session_start(); 
    if ($au=$_SESSION['_amember_user']){ // user is logged-in
    
    echo '<div> Welcome $au[name_f] $au[name_l]</div>';
    
    } else { // user is not logged-in
    
    echo '<div>Please Login</div>';
    
    } 
    {/php}
    
    

Share This Page