Characters getting replaced

Hi -

When users register on my site they enter an email address which needs to be validated. This works without error most of the time.

Unfortunately - new users that have an underscore _ in their email address are having problems.

They enter their email address successfully AND receive a validation email. However, when they click on the link they receive an error. When they contact me I check on their email address in my database and find that the underscore has been replaced with a / followed by a space.

Clearly there is some code somewhere that is replacing the character ‘_’ with '/ ’ and can’t find where. Part of the problem is that I really don’t know what to look for.

Does anyone know a common function that could be doing this?

mysql_escape_string could be doing that and trust me do not remove the function, it protects you from hackers(well not totally but somewhat that is another subject completely), what you need to do is tell your users they cannot sign up with non-alphanumeric characters in there email address other than @ and .com, or use regex / pregmatch to validate the email address
[php]
preg_match(’/^[^@]+@[a-zA-Z0-9._-]+.[a-zA-Z]+$/’, $email)
[/php]
I hate to even put a preg match cause a hundred other people will have a better one LOL

Sponsor our Newsletter | Privacy Policy | Terms of Service