Help - Search - Members - Calendar
Full Version: dashes in email address rejected at checkout
CubeCart Forums > General > General Discussion
4thgear
I have discover a problem with email addresses at checkout. If a customer has an email address dashes in it they get this error message...

<b>Either no email was entered or it was not valid!</b>

Example of email addressess affected:

test-mail@somedomain.com

test@some-domain.com

Anyone have any ideas?
twisted
This is the code in customers.php that determines which characters are "Allowed" in email addresses.
"// make sure email was entered or valid
if ((!ereg("^[a-zA-Z0-9_.]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$", $email))or(empty($email)))"
As you canb see...dashes are permitted...so in short..............no idea.
You might try changing this:
CODE
if ((!ereg("^[a-zA-Z0-9_.]

to this:
CODE
if ((!ereg("^[a-zA-Z0-9_.\-]

And yes, the dash has to be escaped with a \

HTH
booker
(Note that there are 2 locations in the customer.php file where you need to make that change...)
twisted
I smetiems think that some things should go without saying,,,but I should know better.
I implied that the code I posted should be corrected wherever it occurs. tongue.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.