5 * This page is for users to edit their account information
6 * such as their password, email address, etc. Their
7 * usernames can not be edited. When changing their
8 * password, they must first confirm their current password.
10 * Written by: Jpmaster77 a.k.a. The Grandmaster of C++ (GMC)
11 * Last Updated: August 26, 2004
13 include("include/session.php");
17 <title
>Jpmaster77
's Login Script</title>
22 * User has submitted form without errors and user's
23 * account has been edited successfully
.
25 if(isset($_SESSION['useredit'])){
26 unset($_SESSION['useredit']);
28 echo "<h1>User Account Edit Success!</h1>";
29 echo "<p><b>$session->username</b>, your account has been successfully updated. "
30 ."<a href=\"main.php\">Main</a>.</p>";
37 * If user is not logged in, then do not display anything.
38 * If user is logged in, then display the form to edit
39 * account information, with the current email address
40 * already in the field.
42 if($session->logged_in
){
45 <h1
>User Account Edit
: <?
echo $session->username
; ?
></h1
>
47 if($form->num_errors
> 0){
48 echo "<td><font size=\"2\" color=\"#ff0000\">".$form->num_errors
." error(s) found</font></td>";
51 <form action
="process.php" method
="POST">
52 <table align
="left" border
="0" cellspacing
="0" cellpadding
="3">
54 <td
>Current Password
:</td
>
55 <td
><input type
="password" name
="curpass" maxlength
="30" value
="
56 <?echo $form->value("curpass
"); ?>"></td
>
57 <td
><?
echo $form->error("curpass"); ?
></td
>
60 <td
>New Password
:</td
>
61 <td
><input type
="password" name
="newpass" maxlength
="30" value
="
62 <? echo $form->value("newpass
"); ?>"></td
>
63 <td
><?
echo $form->error("newpass"); ?
></td
>
67 <td
><input type
="text" name
="email" maxlength
="50" value
="
69 if($form->value("email
") == ""){
70 echo $session->userinfo['email'];
72 echo $form->value("email
");
76 <td
><?
echo $form->error("email"); ?
></td
>
78 <tr
><td colspan
="2" align
="right">
79 <input type
="hidden" name
="subedit" value
="1">
80 <input type
="submit" value
="Edit Account"></td
></tr
>
81 <tr
><td colspan
="2" align
="left"></td
></tr
>