Jump to content

Yuzi

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Everything posted by Yuzi

  1. [!--quoteo(post=366152:date=Apr 18 2006, 09:05 PM:name=Chris Leah)--][div class=\'quotetop\']QUOTE(Chris Leah @ Apr 18 2006, 09:05 PM) [snapback]366152[/snapback][/div][div class=\'quotemain\'][!--quotec--] the session is saved, but it's not straight after login, even though your logged in to see it, its more of like, a paragraph of text then sayng they user name.....but I have no idea to get the users name to appear...:( eg: Yo .currentuser. how are you today, please submit the scriptcheck before proceeding.. [/quote] I was also trying to display the username, i'm using this once, they're logged in, just rip the username strate out of the session variable... <?php if ($_SESSION['MM_Username'] != NULL) { ?> Welcome,<?php echo " ".$_SESSION['MM_Username']; ?> basically, the username is stored in a session variable, so you test to see if they're logged in (as when they're not logged in, the session variable is NULL. If they are logged in, then you display "Welcome <user>". There is a bit more to the code, which if the user is not logged in, it display's a login form. But hopefully that bit will get it working for you!
  2. [!--quoteo(post=356186:date=Mar 18 2006, 05:37 PM:name=TEENFRONT)--][div class=\'quotetop\']QUOTE(TEENFRONT @ Mar 18 2006, 05:37 PM) [snapback]356186[/snapback][/div][div class=\'quotemain\'][!--quotec--] by using an if statement - set $logged in to the username of user ( im not sure how your setting username so il leave this to you ) if ($loggedin) { //if the user is logged in echo ""; // display nothing } else { // if rhe user is not logged in and $loggedin is not set echo "<form> form code etc"; // display the form } [/quote] Hi, i've just tried this out, I can get it to determine if a user is logged in or not, using the fact that a username is logged in on the session... where i'm having trouble is getting it to display the form... at this point: [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--] else { // if rhe user is not logged in and $loggedin is not set echo "<form> form code etc"; // display the form } [/quote] I can't seem to get it to display the form instead, i always get this error: Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in C:\Program Files\xampp\htdocs\loginTest\normal.php on line 60 any help, i'm very new to PHP, just need to get this little bit working! How do i need to put the form code into the echo statement [b]exactly[/b] to get it to display the form!! Any help would be much appreciated. thnx!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.