Smarty Tags On Sub

Discussion in 'Customization & add-ons' started by meenxo, Mar 2, 2005.

  1. meenxo

    meenxo Guest

    Hello guys,
    Thought Id post on the forum instead of directly contacting support, so that way everyone will be able to find a solution for this.

    I have a smarty tag on member.html
    Welcome, {$smarty.session._amember_user.name_f} {$smarty.session._amember_user.name_l}

    when I log into member.php, it works great, it shows first and last name! But the problem is that I have a gallery script inside amember/gallery, I also want to show the first and last name of the user on my sub php files. So I want amember/gallery/index.php (which has an html temp, inside gallery/templates) to introduce users with the first and last as well, Ive tried to add this

    Welcome, {$smarty.session._amember_user.name_f} {$smarty.session._amember_user.name_l}

    To the html file, but when I go to index.php nothing is there other than "welcome,"

    Is it possible? how?
  2. alex

    alex aMember Pro Customer Staff Member

    Joined:
    Jan 24, 2004
    Messages:
    6,021
    add the following code to your PHP file.
    To very first line of file, add line:
    PHP:
    <?php session_start(); ?>
    then add where you need to display:
    PHP:
    <?php print "Welcome, ".$_SESSION[_amember_user][name_f]." ".$_SESSION[_amember_user][name_l]; ?>

Share This Page