Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2005
    Location
    Los Angeles, CA
    Posts
    17

    Unanswered: User Login Specific Page

    I have implemented PHP Sessions successfully on my login page. Now, I would like to have a user control panel(members only page) were user specific info from the database would be displayed, based on the active USER specific session.

    On the login page session variable is:


    PHP Code:
    $HTTP_SESSION_VARS ['valid_user'] = $login;
    ?> 

    login is also a column fire in the database.

    Here is a simplified version of the panel(members only page)



    PHP Code:
    <?
    session_start
    ();

    $db mysql_connect 'localhost''FAKE_LOGIN''FAKE_PASSWORD' );
    mysql_select_db 'realest1_proppost'$db);
    $result mysql_query("SELECT * FROM customerindex WHERE login='$login'",$db);
    $myrow mysql_fetch_array($result);
    echo 
    "First Name: ".$myrow["cfirstname"];
    echo 
    "<br />";
    echo 
    "Last Name: ".$myrow["clastname"];
    echo 
    "<br />";
    echo 
    "Email Address: ".$myrow["cemail"];
    echo 
    "<br />";
    echo 
    "Login: ".$myrow["login"];
    ?>
    The page is not showing the user specific info only:
    First Name:
    Last Name:
    Email Address:
    Login:

    Any suggestions?

  2. #2
    Join Date
    Feb 2005
    Location
    Los Angeles, CA
    Posts
    17
    Figured it out!

    PHP Code:
    $db = mysql_connect ( 'localhost', 'FAKE_USER', 'FAKE_PASSWORD' );
    mysql_select_db ( 'realest1_proppost', $db);
    $result = mysql_query("SELECT * FROM customerindex WHERE login='$login'",$db);
    $myrow = mysql_fetch_array($result);

    <? echo $myrow["cfirstname"?>

    <? echo $myrow["cmidinitial"?>

    <? echo $myrow["clastname"?>

Posting Permissions

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