Article Contents Related Articles Tags
  • No tags found.
Was This Helpful? Last Updated
  • 2012/07/02

Custom Account Update Forms

If you would like to create a custom "Update Account" page for your users, you can do this in the following manner. Note that you will still need to establish updatable fields from the program options.

Form Components

<form action="/members/member_cp/edit_account.php" method="post" enctype="multipart/form-data">
<input type="hidden" name="action" value="update_contact" />

<label>New Password</label>
<input type="password" name="password" />

<label>Confirm New Password</label>
<input type="password" name="repeat_pwd" />

<label>E-Mail</label>
<input type="text" name="email" />

<input type="submit" value="Update Password" />
</form>

Custom Fields

You can include any custom field on the form. Just remember that custom fields are "cAsE SenSitIve". You can find the exact field names from "Settings » Custom Fields".

Pulling Current Information

The form is relatively useful unless you allow the program to pull the logged in user's account information and use this to populate the form fields with the existing information. This can be done using the code provided here.

Example: customAccountUpdate.php

Note that this must be a ".php" file.
<?php
include "/path/to/members/member_cp/user_data.php";
// User is not logged in, so
// redirect him/her to the
// login page.
if ($logged_in != '1') {
  header('Location: http://www.yoursite.com/members/login.php');
  exit;
}
?>

<form action="/members/member_cp/edit_account.php" method="post" enctype="multipart/form-data">
<input type="hidden" name="action" value="update_contact" />

<label>New Password</label>
<input type="password" name="password" />

<label>Confirm New Password</label>
<input type="password" name="repeat_pwd" />

<label>E-Mail</label>
<input type="text" name="email" value="<?php echo $user['email']; ?>" />

<label>First Name</label>
<input type="text" name="first_name" value="<?php echo $user['first_name']; ?>" />

<label>Last Name</label>
<input type="text" name="last_name" value="<?php echo $user['last_name']; ?>" />

<input type="submit" value="Update Account" />
</form>