Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Mar 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Custom page based off username

    Hey gang, just looking for a small bit of help here if you could.

    The system I am working on is this:

    1) Login
    2) Loads User Profile Page
    3) This page is custom to the user, so they can edit their details and such (e-mail, age, etc).
    4) What I am not worried about is the login information, the database change information (changing age from 22 to 23 for example) and the database pull of information (pulling the original values for viewing).
    5) What I am looking for help on is just the custom page. I just want to create one page (profile.php for example) that will be custom to the users login.

    If you need any more questions answered, I will. I just have no idea where to start to get it to load the information based off the username.

    What I am thinking is something along these lines:

    PHP Code:
       $query "SELECT age, email from USERS where uid='" $username "'"
    Thank you in advance guys/gals.

  • #2
    Senior Coder
    Join Date
    Aug 2003
    Location
    One step ahead of you.
    Posts
    2,815
    Thanks
    0
    Thanked 3 Times in 3 Posts
    When the user logs in his user id should be added to his session. All other pages would acces his user id from the session.
    You can read about sessions in the PHP manual: http://www.php.net/session
    I'm not sure if this was any help, but I hope it didn't make you stupider.

    Experience is something you get just after you really need it.
    PHP Installation Guide Feedback welcome.


  •  

    Posting Permissions

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