Results 1 to 4 of 4

Thread: Having trouble displaying variables. [SOLVED]

Threaded View

  1. #1

    Thread Starter
    Member
    Join Date
    May 2004
    Location
    Where i am
    Posts
    38

    Resolved Having trouble displaying variables. [SOLVED]

    Basically i store their username when they log in and want their control panel to say Hello welcome back [username goes here].

    But for some reason i can't get it to work.
    This is the code i am using.
    (To see if the have logged in i use a variable).

    Code:
    <?
    If ($_SESSION[login]=1){
    print($_SESSION[user]);
    } else {
    echo 'Not logged in';
    }
    ?>
    Before you ask me to check the variable, if i use this code it returns the message (Welcome back Scott).

    Code:
    <?
    If ($_SESSION[user]=Scott){
    print('Welcome back Scott');
    } else {
    echo 'Not logged in as Scott';
    }
    ?>
    Any help would be appreciated.
    Last edited by machinist; May 24th, 2005 at 01:25 PM. Reason: Solved

Posting Permissions

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



Click Here to Expand Forum to Full Width