Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2008
    Posts
    1,153
    Tokens
    199

    Latest Awards:

    Default Login session help [+rep]

    Okay, so i have made a login session for my site and it registers a session called username. When you login you go to a client area. but what i need help with is that when you click home it takes you back to the home but i need the php to get the users name in the top right of the navigation. i can do the css and html for it but i cant do the html. help.

    (clearer: I want it to check for the registered session,if it is found i want it to echo something. if it isnt found then i want it to echo something )

    Help me please.

  2. #2
    Join Date
    Feb 2006
    Location
    Scotland
    Posts
    2,087
    Tokens
    138

    Latest Awards:

    Default

    Well it would be something just like:

    PHP Code:
    <?PHP
    if ($_SESSION['username']) {
    $username $_SESSION['username'];

    echo 
    $username
    } else {

    echo 
    'Not logged in';
    }
    ?>
    I reckon that would work, I would do it a bit better but sitting in a tent with a friend!

  3. #3
    Join Date
    Apr 2008
    Posts
    1,153
    Tokens
    199

    Latest Awards:

    Default

    Quote Originally Posted by Johno! View Post
    Well it would be something just like:

    PHP Code:
    <?PHP
    if ($_SESSION['username']) {
    $username $_SESSION['username'];

    echo 
    $username
    } else {

    echo 
    'Not logged in';
    }
    ?>
    I reckon that would work, I would do it a bit better but sitting in a tent with a friend!
    It wont work, when i log in it still says not logged in. I have sent you a pm, please read it.
    Last edited by Javascrypt; 31-05-2009 at 10:47 AM.

  4. #4
    Join Date
    Feb 2006
    Location
    Scotland
    Posts
    2,087
    Tokens
    138

    Latest Awards:

    Default

    I haven't gotten a PM, sure you sent it to me?

    EDIT: Ok, I received it now.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •