Specifications
LISTING 28.11 Continued
$result = mysql_query($query);
return $result;
}
The subscribe() function adds a row to the sub_lists table corresponding to the subscrip-
tion; the unsubscribe() function deletes this row.
Changing Account Settings
The Account Settings button, when clicked, activates the account-settings action. The code for
this action is as follows:
case ‘account-settings’ :
{
display_account_form($normal_user, $admin_user, get_email(),
get_real_name(get_email()), get_mimetype(get_email()));
break;
}
As you can see, we are reusing the display_account_form() function that we used to create
the account in the first place. However, this time we are passing in the user’s current details,
which will be displayed in the form for easy editing. When the user clicks on the submit button
in this form, the store-account action is activated as discussed previously.
Changing Passwords
Clicking on the Change Password button activates the change-password action, which triggers
the following code:
case ‘change-password’ :
{
display_password_form();
break;
}
The display_password_form() function (from the output_fns.php library) simply displays a
form for the user to change his password. This form is shown in Figure 28.9.
Building a Mailing List Manager
C
HAPTER 28
28
BUILDING A
MAILING LIST
MANAGER
689
34 7842 CH28 3/6/01 3:46 PM Page 689