Does anyone know how to get a user's username with a bit of php code? I need to display it on a menu bar.
i did that in header.html.php and it's throwing this error: "SEVERITY: UNDEFINED index variable _amember_user" funny thing is ill logout then login and the username will appear instead of this error.
header.html.php... what file is this? One you wrote or an amember file? If you are using the amember file header.html you shouldnt be using the <?php> tags. Its smarty. Use {$smarty.session._amember_user.name_f} David
It's part of code igniter. This is the portion of code thats giving error: Code: <?php if ( !defined('AMEMBERINTEGRATION') || !AMEMBERINTEGRATION || !isset($isValidAmemberUser) || (isset($isValidAmemberUser) ? !$isValidAmemberUser : true) ) {?> <div id="login2"> <span class="style8"><?php print "Welcome, " . $_SESSION['_amember_user']['name_f'] . " " . $_SESSION['_amember_user']['name_l']; ?>! </span> </div> <?php } else { ?> <div id="login">XXXX</div> <?php }?>
Code not working but may be my fault... I have a regular html coded page with a .php extension. I included the session start code at very top of page and then the "Welcome" code at start of body area. Only the word "Welcome," is showing, members ID or Name is not. Can this have something to do with the fact that after in have <?php session start ?> code at top of page I have HTML tag stc following it. Should I get rid of html tag? I'm not good at coding php though I use php extensions because of "include" codes I use. Any answers? Thanks John J.
Give this a try: session_save_path(dirname(__FILE__)."/amember/sess/"); session_start(); I think that sometimes the script session location and amembers are different. David