Contributions
Uppercase for the name of customers
The goal is to force the creation of the customer name and firstname as follow :
Whatever the way the customer will enter his information, instead of having "joe black", you will get "Joe BLACK" in your database.
1. Open the file "create_account.php"
2. Close to line 20, find :
$firstname = tep_db_prepare_input($HTTP_POST_VARS['firstname']);
$lastname = tep_db_prepare_input($HTTP_POST_VARS['lastname']);
and replace by :
$firstname = tep_db_prepare_input(strtoupper($HTTP_POST_VARS['firstname']{0}) . substr($HTTP_POST_VARS['firstname'], 1));
$lastname = tep_db_prepare_input(strtoupper($HTTP_POST_VARS['lastname']));
Enjoy...
| Expert | 19 Jun 2005 |
Too make a string's first letter to uppercase ucfirst(string) function does this easily.
$firstname = tep_db_prepare_input(ucfirst($HTTP_POST_VARS['firstname']));
| Will | 16 Jun 2005 |
Note: Contributions are used at own risk.
