How can I setup a different home page for each user in PHP?

Discussion in 'PHP' started by webshaker123, Jan 8, 2006.

  1. #1
    I want to setup a different home page for each user logging into my site. I want each user to see only what I have posted for them and them only. Can anyone offer any help or am I dreaming that this can be done with a PHP website?


    Newbie
     
    webshaker123, Jan 8, 2006 IP
  2. Big 'G'

    Big 'G' Member

    Messages:
    89
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    48
    #2
    Easy to do.. After logging in run a redirect or inlcude to the particular page for them as stored in the db
     
    Big 'G', Jan 9, 2006 IP
  3. webshaker123

    webshaker123 Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    sounds easy, do you have any samples as to how a redirect would look?
    I guess if i used an if statment something like that could work.
     
    webshaker123, Jan 9, 2006 IP
  4. Big 'G'

    Big 'G' Member

    Messages:
    89
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    48
    #4
    Well alot depends on the information to display to them if it is a full page
    run your login script to verify user. Then grab the content page for that user
    //DB SETUP ROGUGH
    USERID:NAME:pWORD:CONTENT:
    1:USER:1234:SPECIALS.PHP
    //Grab USER PAGE FROM db
    $sql =mysql_query("SELECT CONTENT FROM TBL WHERE NAME='' AND PWORD=''")
    $DETAILS=MYSQL_FETCH_ASSOC($sql)
    $GO =$DETAILS['CONTENT']
    //Include the page as per db value
    INCLUDE '$GO'
    //OR
    HEADER("LOCATION:HTTP:WWW.YOURSITE.COM/$GO")

    Very rough draft (too tired) but if you fimiar with php u should get the jist else have to wait for later for a more in depth example
     
    Big 'G', Jan 9, 2006 IP
  5. onlyican.com

    onlyican.com Peon

    Messages:
    206
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #5
    MySQL DB

    have fields, like username, font size, message,
    then "SELECT * FROM customers WHERE username = '".$username."'"
     
    onlyican.com, Jan 9, 2006 IP