Smarty error: syntax error: unrecognized tag 'print'

Discussion in 'Troubleshooting' started by momilynn, Mar 18, 2008.

  1. momilynn

    momilynn New Member

    Joined:
    Feb 26, 2008
    Messages:
    5
    I'm trying to get this to work

    PHP:
    if($_SESSION[_amember_user]){
    print (
    User is logged in);
    }else{
    print (
    User is not logged in);
    }

    but get Smarty error: syntax error: unrecognized tag 'print'


    Anyone tried this before and got it to work? Or is it something that I;m doing wrong?

    Thanks,
    Momi
  2. davidm1

    davidm1 aMember User & Partner

    Joined:
    May 16, 2006
    Messages:
    4,437
    Instead of print try echo " ";

    If you are putting the code in an amember template you may want to use just smarty to do what you need:
    {if $smarty.session._amember_login}
    Logged in
    {else}
    Not logged in
    {/if}

    David
  3. momilynn

    momilynn New Member

    Joined:
    Feb 26, 2008
    Messages:
    5
    Thanks davidm1 I'll give it a shot.
    By the way do you think the smarty would do an include ('')?



    Aloha,
    Momi :)
  4. momilynn

    momilynn New Member

    Joined:
    Feb 26, 2008
    Messages:
    5
    Here is the tag that worked for all those out there wanting to know...
    Code:
    {if $smarty.session._amember_user}User is logged in{else}User is not logged in{/if}
    
    Mahalo,
    Momi

    Thanks again, David

Share This Page