easy way to make a simple user system

Discussion in 'PHP' started by HHGS!, Nov 11, 2009.

  1. #1
    Well im wanting to simply start with making a easy user system, at the moment. something along the lines of
    Username
    Password
    so a login, then once logged in i can use the command $username for stuff like Welcome $username ect...
    Ross
     
    HHGS!, Nov 11, 2009 IP
  2. xenon2010

    xenon2010 Peon

    Messages:
    237
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    use sessions:
    - set session start.
    - store username is the session after he logs in.
    - then use the saved session in any script/page you want..

    for example:
    session_start();
    //after login save username in the session
    $_SESSION['username'] = $username;
    
    //now you can use the session in any page you want just call this session
    echo $_SESSION['username'];
    PHP:
     
    xenon2010, Nov 11, 2009 IP