To make the first name and last name fields mandatory, follow these simple steps:
1. Open the file listmessenger.php in the public directory
2. Find the following line on line 97
// Error checking for e-mail address information.
3. Insert the following code BEFORE this line
// Error checking for missing first or last name
if((!$info["firstname"]) || (trim($info["firstname"]) == "")) {
$ERROR++;
$TITLE = $language_pack["error_default_title"];
$MESSAGE = $language_pack["error_subscribe_no_firstname"];
}
if((!$info["lastname"]) || (trim($info["lastname"]) == "")) {
$ERROR++;
$TITLE = $language_pack["error_default_title"];
$MESSAGE = $language_pack["error_subscribe_no_lastname"];
}
5. Save and close the file
6. Open the file english.lang.php in the public/languages directory
7. Find the following line:
$language_pack["error_subscribe_no_email"] = "Please enter an e-mail address that you would like subscribed to our mailing list.";
8. Insert the following code AFTER this line:
$language_pack["error_subscribe_no_firstname"] = "Please enter your first name to subscribe to our mailing list.";
$language_pack["error_subscribe_no_lastname"] = "Please enter your last name to subscribe to our mailing list.";
Make similar modifications to any alternative language files you may have.
9. Save and close the file
10. Upload the two files you just modified to the correct locations on your host.
Please make backups of any files before you make any changes, this is if anything should go wrong you can then restore the originals.
Article is in the following categories:
KB » mosListMessenger
KB » mosListMessenger

Our Main FAQ
Making the first name and last name fields mandatory




Leave A Comment
Email This Article
My Notes
Related Articles
Article Information





