7 Replies Latest reply on Mar 29, 2012 1:19 PM by wizbard

    Allowing a member to see/edit their details once logged in

    Level 1
      Hi,

      I'm sure there is a simple answer to this question. I am developing a members type site where I want a member to on login be directed to a page which displays a dymaic form allowing them to edit only their details but cant figure that part out.

      I have the login page and form all working fine it's just how do i get the login info from the login page to call up their account details from a DB

      I am using DWCS3 with Developer toolbox and am using PHP & MYSQL

      Thanks in advance for your help
        • 1. Re: Allowing a member to see/edit their details once logged in
          Level 1
          Hello Shannon,

          I have a suggestion for a fairly easy way to do this, but I am going to have to make a couple of assumptions based on limited information about exactly what you are doing.

          1. I am assuming that you want the member to be directed to the same page where they can edit their information everytime they login, not just the first time they login.

          2. I am assuming that the table that you want to update is the same table that the member's login information is contained in. In other words, the member information table that you want the customer to update is the same table you told the Developer Toolbox to check for the members username and password.

          Assuming this is true, it should be fairly easy. If my assumptions are wrong, it's still possible, but would be more complicated perhaps.

          Goto the Developer Toolbox Control panel and select Login Settings.
          Click on the Sessions tab. There should be a session variable set to hold the primary key of the user's record when they login. Usually the default is kt_login_id I think. This session variable is set when the user logs in and holds the unique primary key that matches that user's record in your database. Just check to see that this is set and check the name it is set to(kt_login_id most likely).

          Next, open the redirect page that the user is sent to after successful login...let's say its memberupdate.php The redirect pages can be changed in the Login Settings as well if needed.

          Run the Developer Toolbox's Update Record Form Wizard. On the first Step, 1/3 Look for the "Primary Key Equals" dropdown menu.

          Select Session Variable in the dropdown and in the text box to the right enter kt_login_id

          Finish the wizard and the test it out.

          One important note, you need to have set the memberupdate.php page (or whatever your page's name is) with the Developer Toolbox's "Restrict Access To Page" server behavior. Other wise the form will not see the session variable. This can also be manually done with the following php code if neccessary:

          session_start();

          Hopefully my assumptions about what you are trying to do are correct. This is the easiest way I could think of, but I am still fairly new at this. Some of the pros out there might be able to make a better suggestion.

          Hope this helps

          Shane
          • 2. Re: Allowing a member to see/edit their details once logged in
            Level 1
            Thanks Shane,

            Your assumpitions were correct.That was very simple fix and everything works fine

            Cheers
            Shannon
            • 3. Re: Allowing a member to see/edit their details once logged in
              mkaylen

              How do I do this same thing with cs4 it doesn't have the toolbox?

              • 4. Re: Allowing a member to see/edit their details once logged in
                Günter Schenk Level 4

                mkaylen wrote:

                 

                How do I do this same thing with cs4 it doesn't have the toolbox?

                http://www.adobe.com/support/dreamweaver/addt/downloads_updaters.html

                Cheers,
                Günter

                • 5. Re: Allowing a member to see/edit their details once logged in
                  envisionmarketing

                  Hallo, I'm trying to do the same thing but in CS5 (no ADDT).  Any help you can give would be wonderful.   Thanks in advance for your assistance!

                  • 6. Re: Allowing a member to see/edit their details once logged in
                    Andoyo Andoyo

                    This answer can run on Dreamweaver CS3, CS4 and CS5 or higher.

                    Use your session variable to do it.

                     

                    In this example, we will used MySQL table called "admin":

                    CREATE TABLE IF NOT EXISTS `admin` (

                      `id` int(10) NOT NULL AUTO_INCREMENT,

                      `name` varchar(64) NOT NULL,

                      `email` varchar(64) NOT NULL,

                      `username` varchar(64) NOT NULL,

                      `password` varchar(64) NOT NULL,

                      `activation` varchar(64) NOT NULL,

                      `level` int(2) NOT NULL DEFAULT '0',

                      `date_registered` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,

                      PRIMARY KEY (`id`)

                    ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;

                     

                    INSERT INTO `admin` (`id`, `name`, `email`, `username`, `password`, `activation`, `level`, `date_registered`) VALUES

                    (1, 'Andoyo', 'andoyoandoyo@gmail.com', 'andoyo', 'andoyo', '8e67d638c0d130a4d66b2888ffc8335b', 0, '2011-09-21 10:32:16');

                    And then, the files we will use are:

                    1. login.php, contain login form
                    2. admin.php, a restricted page
                    3. profile.php, contain a form to update profile logged in user

                    Before we start, make sure you have made a Site Definition or Site Setup and Database Connection (in this sample called: adobe_cookbooks). This is adobe_cookbooks.php:

                    <?php

                    # FileName="Connection_php_mysql.htm"

                    # Type="MYSQL"

                    # HTTP="true"

                    $hostname_adobe_cookbooks = "localhost";

                    $database_adobe_cookbooks = "adobe_cookboks";

                    $username_adobe_cookbooks = "root";

                    $password_adobe_cookbooks = "";

                    $adobe_cookbooks = mysql_pconnect($hostname_adobe_cookbooks, $username_adobe_cookbooks, $password_adobe_cookbooks) or trigger_error(mysql_error(),E_USER_ERROR);

                    ?>

                     

                    This is file: login.php

                    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

                    <html xmlns="http://www.w3.org/1999/xhtml">

                    <head>

                    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

                    <title>Untitled Document</title>

                    </head>

                    <body>

                    <p>Log In Page:</p>

                    <form id="form1" name="form1" method="post" action="">

                      <p><label for="username">Username:</label>

                        <input type="text" name="username" id="username" /></p>

                      <p><label for="password">Password:</label>

                        <input type="password" name="password" id="password" /></p>

                      <p><input type="submit" name="submit" id="submit" value="Log In" />

                        <input type="reset" name="submit2" id="submit2" value="Reset" /></p>

                    </form>

                    <p> </p>

                    </body>

                    </html>

                    Activate your login page:

                    1. Click Insert > Data Objects > User Authentication > Log In User
                    2. Get input from form: form1
                    3. Username field: username
                    4. Password field: password
                    5. Validate using connection: adobe_cookbooks
                    6. Table: admin
                    7. Username column: username, click pop up menu to choose it
                    8. Password column: password
                    9. If login succesds, go to: admin.php
                    10. If login fails, go to: login.php
                    11. Restrict access based on: username and password.
                    12. Click OK
                    13. Save your work

                    See in the code view, you will notice that Dreamweaver generate a session variable called: $MM_Username where username columns is stored as a session. This session variable will be used for the next page to catch all of the detail who are logged in.

                    This is file: admin.php

                    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

                    <html xmlns="http://www.w3.org/1999/xhtml">

                    <head>

                    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

                    <title>Untitled Document</title>

                    </head>

                      <body>

                    <p>Hi ADMIN NAME | Edit your profile</p>

                    <p>This page is protected</p>

                    </body>

                    </html>

                    Make a recordset SESSION VARIABLE (I called it rsSession):

                    1. Click Insert > Data Objects > Recordset
                    2. Name: rsSession
                    3. Connection: adobe_cookbooks
                    4. Table: admin
                    5. Columns: All
                    6. Filter: username, Session Variable, =, MM_Username. Under the Filter option, click pop-up menu and choose Session Variable (the default value is URL Parameter). And in the text field, there is username. Change it to be: MM_Username.
                    7. Click OK
                    8. Save your work

                     

                    Applying the detail of logged in user:

                    1. Find this code:
                      <p>Hi ADMIN NAME | Edit your profile</p>
                    2. Change it to be:
                      <p>Hi <strong><?php echo $row_rsSession['name']; ?> | <a href="profile.php">Edit your profile</a></p>
                    3. Save your work

                     

                    Protecting your admin page:

                    1. Click Insert > Data Objects > User Authentication > Restrict Access To Page
                    2. Restrict access based on: username and password
                    3. If access denied, go to: login.php
                    4. Click OK
                    5. Save your work

                    Form update profile: profile.php

                    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

                    <html xmlns="http://www.w3.org/1999/xhtml">

                    <head>

                    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

                    <title>Untitled Document</title>

                    </head>

                    <body>

                    <p>Edit My Profile</p>

                    <p> </p>

                    </body>

                    </html>

                    See page admin.php.

                     

                    Make a recordset SESSION VARIABLE (I called it rsSession):

                    1. Click Insert > Data Objects > Recordset
                    2. Name: rsSession
                    3. Connection: adobe_cookbooks
                    4. Table: admin
                    5. Columns: All
                    6. Filter: username, Session Variable, =, MM_Username. Under the Filter option, click pop-up menu and choose Session Variable (the default value is URL Parameter). And in the text field, there is username. Change it to be: MM_Username.
                    7. Click OK
                    8. Save your work

                     

                    Make an update form logged in user:

                    1. Click Insert > Data Object > Update Form > Record Update Form Wizard
                    2. Connection: adobe_cookbooks
                    3. Table to update: admin
                    4. Select record from: rsSession
                    5. Unique ID: id, with Numeric must be checked
                    6. After Updating, go to: admin.php
                    7. Form fields:, there are Plus sign thats mean Add item and Minus Sign thats mean Remove item. You will use it
                    8. Click the id column, and click minus sign . This mean we remove id from the form
                    9. Do the same as step 8 to remove item: activation, level and date_registered. We are not going to use them.
                    10. Click the password column.
                    11. Display as: Password field
                    12. Default value: <?php echo $row_rsSession['password']; ?>. You can click thunder bolt sign and then in the Field, click the plus sign to expand the recordset. Click/choose password column
                    13. Click OK
                    14. Click OK again
                    15. Save your work

                     

                    Protecting your profile page:

                    1. Click Insert > Data Objects > User Authentication > Restrict Access To Page
                    2. Restrict access based on: username and password
                    3. If access denied, go to: login.php
                    4. Click OK
                    5. Save your work

                     

                    Now, you can edit logged in user detail. These are the final code:

                     

                    login.php

                    <?php require_once('../Connections/adobe_cookbooks.php'); ?>

                    <?php

                    if (!function_exists("GetSQLValueString")) {

                    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")

                    {

                      if (PHP_VERSION < 6) {

                        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

                      }

                      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

                      switch ($theType) {

                        case "text":

                          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";

                          break;   

                        case "long":

                        case "int":

                          $theValue = ($theValue != "") ? intval($theValue) : "NULL";

                          break;

                        case "double":

                          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";

                          break;

                        case "date":

                          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";

                          break;

                        case "defined":

                          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;

                          break;

                      }

                      return $theValue;

                    }

                    }

                    ?>

                    <?php

                    // *** Validate request to login to this site.

                    if (!isset($_SESSION)) {

                      session_start();

                    }

                     

                     

                    $loginFormAction = $_SERVER['PHP_SELF'];

                    if (isset($_GET['accesscheck'])) {

                      $_SESSION['PrevUrl'] = $_GET['accesscheck'];

                    }

                     

                     

                    if (isset($_POST['username'])) {

                      $loginUsername=$_POST['username'];

                      $password=$_POST['password'];

                      $MM_fldUserAuthorization = "";

                      $MM_redirectLoginSuccess = "admin.php";

                      $MM_redirectLoginFailed = "login.php";

                      $MM_redirecttoReferrer = false;

                      mysql_select_db($database_adobe_cookbooks, $adobe_cookbooks);

                     

                      $LoginRS__query=sprintf("SELECT username, password FROM `admin` WHERE username=%s AND password=%s",

                        GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text"));

                      

                      $LoginRS = mysql_query($LoginRS__query, $adobe_cookbooks) or die(mysql_error());

                      $loginFoundUser = mysql_num_rows($LoginRS);

                      if ($loginFoundUser) {

                         $loginStrGroup = "";

                       

                              if (PHP_VERSION >= 5.1) {session_regenerate_id(true);} else {session_regenerate_id();}

                        //declare two session variables and assign them

                        $_SESSION['MM_Username'] = $loginUsername;

                        $_SESSION['MM_UserGroup'] = $loginStrGroup;               

                     

                     

                        if (isset($_SESSION['PrevUrl']) && false) {

                          $MM_redirectLoginSuccess = $_SESSION['PrevUrl'];

                        }

                        header("Location: " . $MM_redirectLoginSuccess );

                      }

                      else {

                        header("Location: ". $MM_redirectLoginFailed );

                      }

                    }

                    ?>

                    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

                    <html xmlns="http://www.w3.org/1999/xhtml">

                    <head>

                    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

                    <title>Untitled Document</title>

                    </head>

                     

                     

                    <body>

                    <p>Log In Page:</p>

                    <form id="form1" name="form1" method="POST" action="<?php echo $loginFormAction; ?>">

                      <p>

                        <label for="username">Username:</label>

                        <input type="text" name="username" id="username" />

                      </p>

                      <p>

                        <label for="password">Password:</label>

                        <input type="password" name="password" id="password" />

                      </p>

                      <p>

                        <input type="submit" name="submit" id="submit" value="Log In" />

                        <input type="reset" name="submit2" id="submit2" value="Reset" />

                      </p>

                    </form>

                    <p> </p>

                    </body>

                    </html>

                    admin.php

                    <?php require_once('../Connections/adobe_cookbooks.php'); ?>

                    <?php

                    if (!isset($_SESSION)) {

                      session_start();

                    }

                    $MM_authorizedUsers = "";

                    $MM_donotCheckaccess = "true";

                     

                     

                    // *** Restrict Access To Page: Grant or deny access to this page

                    function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) {

                      // For security, start by assuming the visitor is NOT authorized.

                      $isValid = False;

                     

                     

                      // When a visitor has logged into this site, the Session variable MM_Username set equal to their username.

                      // Therefore, we know that a user is NOT logged in if that Session variable is blank.

                      if (!empty($UserName)) {

                        // Besides being logged in, you may restrict access to only certain users based on an ID established when they login.

                        // Parse the strings into arrays.

                        $arrUsers = Explode(",", $strUsers);

                        $arrGroups = Explode(",", $strGroups);

                        if (in_array($UserName, $arrUsers)) {

                          $isValid = true;

                        }

                        // Or, you may restrict access to only certain users based on their username.

                        if (in_array($UserGroup, $arrGroups)) {

                          $isValid = true;

                        }

                        if (($strUsers == "") && true) {

                          $isValid = true;

                        }

                      }

                      return $isValid;

                    }

                     

                     

                    $MM_restrictGoTo = "login.php";

                    if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {  

                      $MM_qsChar = "?";

                      $MM_referrer = $_SERVER['PHP_SELF'];

                      if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";

                      if (isset($_SERVER['QUERY_STRING']) && strlen($_SERVER['QUERY_STRING']) > 0)

                      $MM_referrer .= "?" . $_SERVER['QUERY_STRING'];

                      $MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);

                      header("Location: ". $MM_restrictGoTo);

                      exit;

                    }

                    ?>

                    <?php

                    if (!function_exists("GetSQLValueString")) {

                    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")

                    {

                      if (PHP_VERSION < 6) {

                        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

                      }

                     

                     

                      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

                     

                     

                      switch ($theType) {

                        case "text":

                          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";

                          break;   

                        case "long":

                        case "int":

                          $theValue = ($theValue != "") ? intval($theValue) : "NULL";

                          break;

                        case "double":

                          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";

                          break;

                        case "date":

                          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";

                          break;

                        case "defined":

                          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;

                          break;

                      }

                      return $theValue;

                    }

                    }

                     

                     

                    $colname_rsSession = "-1";

                    if (isset($_SESSION['MM_Username'])) {

                      $colname_rsSession = $_SESSION['MM_Username'];

                    }

                    mysql_select_db($database_adobe_cookbooks, $adobe_cookbooks);

                    $query_rsSession = sprintf("SELECT * FROM `admin` WHERE username = %s", GetSQLValueString($colname_rsSession, "text"));

                    $rsSession = mysql_query($query_rsSession, $adobe_cookbooks) or die(mysql_error());

                    $row_rsSession = mysql_fetch_assoc($rsSession);

                    $totalRows_rsSession = mysql_num_rows($rsSession);

                    ?>

                    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

                    <html xmlns="http://www.w3.org/1999/xhtml">

                    <head>

                    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

                    <title>Untitled Document</title>

                    </head>

                     

                     

                    <body>

                    <p>Hi <strong><?php echo $row_rsSession['name']; ?> | <a href="profile.php">Edit your profile</a></p>

                    <p>This page is protected</p>

                    </body>

                    </html>

                    <?php

                    mysql_free_result($rsSession);

                    ?>

                    profile.php

                    <?php require_once('../Connections/adobe_cookbooks.php'); ?>

                    <?php

                    if (!isset($_SESSION)) {

                      session_start();

                    }

                    $MM_authorizedUsers = "";

                    $MM_donotCheckaccess = "true";

                     

                     

                    // *** Restrict Access To Page: Grant or deny access to this page

                    function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) {

                      // For security, start by assuming the visitor is NOT authorized.

                      $isValid = False;

                     

                     

                      // When a visitor has logged into this site, the Session variable MM_Username set equal to their username.

                      // Therefore, we know that a user is NOT logged in if that Session variable is blank.

                      if (!empty($UserName)) {

                        // Besides being logged in, you may restrict access to only certain users based on an ID established when they login.

                        // Parse the strings into arrays.

                        $arrUsers = Explode(",", $strUsers);

                        $arrGroups = Explode(",", $strGroups);

                        if (in_array($UserName, $arrUsers)) {

                          $isValid = true;

                        }

                        // Or, you may restrict access to only certain users based on their username.

                        if (in_array($UserGroup, $arrGroups)) {

                          $isValid = true;

                        }

                        if (($strUsers == "") && true) {

                          $isValid = true;

                        }

                      }

                      return $isValid;

                    }

                     

                     

                    $MM_restrictGoTo = "login.php";

                    if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {  

                      $MM_qsChar = "?";

                      $MM_referrer = $_SERVER['PHP_SELF'];

                      if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";

                      if (isset($_SERVER['QUERY_STRING']) && strlen($_SERVER['QUERY_STRING']) > 0)

                      $MM_referrer .= "?" . $_SERVER['QUERY_STRING'];

                      $MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);

                      header("Location: ". $MM_restrictGoTo);

                      exit;

                    }

                    ?>

                    <?php

                    if (!function_exists("GetSQLValueString")) {

                    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")

                    {

                      if (PHP_VERSION < 6) {

                        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

                      }

                     

                     

                      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

                     

                     

                      switch ($theType) {

                        case "text":

                          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";

                          break;   

                        case "long":

                        case "int":

                          $theValue = ($theValue != "") ? intval($theValue) : "NULL";

                          break;

                        case "double":

                          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";

                          break;

                        case "date":

                          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";

                          break;

                        case "defined":

                          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;

                          break;

                      }

                      return $theValue;

                    }

                    }

                     

                     

                    $editFormAction = $_SERVER['PHP_SELF'];

                    if (isset($_SERVER['QUERY_STRING'])) {

                      $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);

                    }

                     

                     

                    if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) {

                      $updateSQL = sprintf("UPDATE `admin` SET name=%s, email=%s, username=%s, password=%s WHERE id=%s",

                                           GetSQLValueString($_POST['name'], "text"),

                                           GetSQLValueString($_POST['email'], "text"),

                                           GetSQLValueString($_POST['username'], "text"),

                                           GetSQLValueString($_POST['password'], "text"),

                                           GetSQLValueString($_POST['id'], "int"));

                     

                     

                      mysql_select_db($database_adobe_cookbooks, $adobe_cookbooks);

                      $Result1 = mysql_query($updateSQL, $adobe_cookbooks) or die(mysql_error());

                     

                     

                      $updateGoTo = "admin.php";

                      if (isset($_SERVER['QUERY_STRING'])) {

                        $updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";

                        $updateGoTo .= $_SERVER['QUERY_STRING'];

                      }

                      header(sprintf("Location: %s", $updateGoTo));

                    }

                     

                     

                    $colname_rsSession = "-1";

                    if (isset($_SESSION['MM_Username'])) {

                      $colname_rsSession = $_SESSION['MM_Username'];

                    }

                    mysql_select_db($database_adobe_cookbooks, $adobe_cookbooks);

                    $query_rsSession = sprintf("SELECT * FROM `admin` WHERE username = %s", GetSQLValueString($colname_rsSession, "text"));

                    $rsSession = mysql_query($query_rsSession, $adobe_cookbooks) or die(mysql_error());

                    $row_rsSession = mysql_fetch_assoc($rsSession);

                    $totalRows_rsSession = mysql_num_rows($rsSession);

                    ?>

                    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

                    <html xmlns="http://www.w3.org/1999/xhtml">

                    <head>

                    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

                    <title>Untitled Document</title>

                    </head>

                     

                     

                    <body>

                    <p>Edit My Profile</p>

                    <p> </p>

                    <form action="<?php echo $editFormAction; ?>" method="post" name="form1" id="form1">

                      <table align="center">

                        <tr valign="baseline">

                          <td nowrap="nowrap" align="right">Name:</td>

                          <td><input type="text" name="name" value="<?php echo htmlentities($row_rsSession['name'], ENT_COMPAT, 'utf-8'); ?>" size="32" /></td>

                        </tr>

                        <tr valign="baseline">

                          <td nowrap="nowrap" align="right">Email:</td>

                          <td><input type="text" name="email" value="<?php echo htmlentities($row_rsSession['email'], ENT_COMPAT, 'utf-8'); ?>" size="32" /></td>

                        </tr>

                        <tr valign="baseline">

                          <td nowrap="nowrap" align="right">Username:</td>

                          <td><input type="text" name="username" value="<?php echo htmlentities($row_rsSession['username'], ENT_COMPAT, 'utf-8'); ?>" size="32" /></td>

                        </tr>

                        <tr valign="baseline">

                          <td nowrap="nowrap" align="right">Password:</td>

                          <td><input type="password" name="password" value="<?php echo $row_rsSession['password']; ?>" size="32" /></td>

                        </tr>

                        <tr valign="baseline">

                          <td nowrap="nowrap" align="right"> </td>

                          <td><input type="submit" value="Update record" /></td>

                        </tr>

                      </table>

                      <input type="hidden" name="MM_update" value="form1" />

                      <input type="hidden" name="id" value="<?php echo $row_rsSession['id']; ?>" />

                    </form>

                    <p> </p>

                    <p> </p>

                    </body>

                    </html>

                    <?php

                    mysql_free_result($rsSession);

                    ?>


                     

                    Message was edited by: Andoyo Andoyo

                    • 7. Re: Allowing a member to see/edit their details once logged in
                      wizbard

                      Just wanted to say thanks (over-and-over)!  I followed your instructions and it worked the first time!