Gossamer Forum
Home : Products : Gossamer Links : Discussions :

An addition to User.cgi

Quote Reply
An addition to User.cgi
Hi Alex:

This may be a bit of overkill, but here is an idea I have found useful.

The current test for valid e-mail addresses is good, but there are a couple other "tests" that could be added in to get rid of more bogus e-mails. I have found 2 very common mistakes, adding spaces in the address, and prefixing the e-mail with a www

So I add these:

In Reply To:

if ($email =~/ /) {
print Links::SiteHTML::display ('signup_form', { error => Links::language('USER_INVALIDEMAIL2', $email) });
return;
}
if ($email =~/www/) {
print Links::SiteHTML::display ('signup_form', { error => Links::language('USER_INVALIDEMAIL3', $email) });
return;
}
Obviously, I have added custom error messages for these instances.

The space-in-an-address problem can be partictlary troubling if you include a URL for automatic unsubscribing- the space messes up the URL.

Anyway, may be overkill, but there you go!

dave