PHP Classes

Trimming Email Addresses

Recommend this page to a friend!

      PHP Forms Class with HTML Generator and JavaScript Validation  >  PHP Forms Class with HTML Generator and JavaScript Validation package blog  >  How to Show Google Ma...  >  All threads  >  Trimming Email Addresses  >  (Un) Subscribe thread alerts  
Subject:Trimming Email Addresses
Summary:Where to Trim the email address during verification?
Messages:3
Author:Pete Clark
Date:2009-10-20 07:50:28
Update:2009-10-20 10:38:59
 

  1. Trimming Email Addresses   Reply   Report abuse  
Picture of Pete Clark Pete Clark - 2009-10-20 07:50:28
I have a client who insists on putting a space at the end of his email address. I know this, because I have seen screen shots, and the space is visible in the "do you want to save password" message from the browser.

Of course, spaces are not allowed in email addresses, so it fails the verification.

It should be simple enough to add a Trim() somewhere, but I can't see it! Can anyone tell me where I should add it, please.

  2. Re: Trimming Email Addresses   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2009-10-20 09:25:37 - In reply to message 1 from Pete Clark
Use ReplacePatterns parameter like in the documentation to trim whitespace before and after the e-mail address.

  3. Re: Trimming Email Addresses   Reply   Report abuse  
Picture of Pete Clark Pete Clark - 2009-10-20 10:38:59 - In reply to message 2 from Manuel Lemos
Thanks for the quick response. Will check there.