Skip to main content
Participant
Jul 12, 2009 5:29 PM UTC
Question

Member Account Page Problem

Hello Dreamweaver Professional. I am currently having some problems with my app developement. I have a user/member sections for my client and within it he would like to have an "Member Accout" page that the member's can go and update there personal info. So I created a "Record Set" to the members table in MySQL database. So when the member logs in to the "Member Section" they have a button that is visible to them. It says "Member Account". The code that I link to the account page is the following:

memaccount.php?id=<?php echo $row_rsMembers['id']; ?>

The frustrating thing is that when they go to that page the 1st record information appears in my Update Form, not there info. I also used the "Record Update Form Wizard" on my account page.In the "Member Account" page I created the record set that has the following filter:

id = URL "id"

If you would like to look at the website it is www.patsentriders.org on the login page you can use the following:

Username - test

Password - test

What could be done to fix this problem? (I am using Dreamweaver CS3)

This topic is closed to new replies. Start a new post to keep the conversation going.

6 replies

Participating Frequently
Jul 12, 2009 7:04 PM UTC

The link is using ID #1, so it probably is not being passed to the member.php page correctly. This could be related to the error message that is displayed:

Warning:  session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /hermes/bosweb/web091/b913/sl.greywolf135/public_html/mems/member.php:1) in /hermes/bosweb/web091/b913/sl.greywolf135/public_html/mems/member.php on line 5

This message could indicat that you are using a redirect after the page headers have already been sent. We would have to review the code on the form processing script to see what is happening, but you should check to make sure that nothing that would send the header data to the browser is in your code prior to the redirect. Search the web for 'Cannot send session cache limiter - headers already sent' for more causes and fixes.

Translate
Participant
Jul 12, 2009 11:23 PM UTC

Hey bergent. Here is the form processing the script:

<?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['username1'])) {
  $loginUsername=$_POST['username1'];
  $password=$_POST['password1'];
  $MM_fldUserAuthorization = "level";
  $MM_redirectLoginSuccess = "member.php";
  $MM_redirectLoginFailed = "login.php?failed=Either your Username or Password is incorrect. Or you do not have the correct access level.";
  $MM_redirecttoReferrer = true;
  mysql_select_db($database_Members, $Members);
  
  $LoginRS__query=sprintf("SELECT username, password, level FROM members WHERE username=%s AND password=%s",
  GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text"));
  
  $LoginRS = mysql_query($LoginRS__query, $Members) or die(mysql_error());
  $loginFoundUser = mysql_num_rows($LoginRS);
  if ($loginFoundUser) {
   
    $loginStrGroup  = mysql_result($LoginRS,0,'level');
   
    //declare two session variables and assign them
    $_SESSION['MM_Username'] = $loginUsername;
    $_SESSION['MM_UserGroup'] = $loginStrGroup;     

    if (isset($_SESSION['PrevUrl']) && true) {
      $MM_redirectLoginSuccess = $_SESSION['PrevUrl'];
    }
    header("Location: " . $MM_redirectLoginSuccess );
  }
  else {
    header("Location: ". $MM_redirectLoginFailed );
  }
}
?>

I used the "Login In User" server behavior from Dreamweaver. I also have the registration form on the same page as the login form. And with that the registration form is using the "Insert Record" server behavior. Could that be causing the issue too?

Translate
Participating Frequently
Jul 13, 2009 1:12 AM UTC

The problem is that you are sending html to the browser before calling the session start. If you want to combine the form and script on the same page, you need to have the script first, before ANY html.

Translate