why not drop everything after the @, add that on using php after they click submit or whatever, then just verify the [USERNAME] box with a if $x = statement?
HawkeVIPER
Junior Poster in Training
72 posts since Jan 2005
Reputation Points: 10
Solved Threads: 4
ok I think this was what u asked. ..
you wanted a script that validating some e-mail address that *MUST* have a domain of landau-forte.org.uk
if i am correct then this should do the job
function if_email($email)
{
//Check to make sure this is a valid email address on landau-forte.org.uk
if (ereg('^[a-zA-Z0-9_\.\-]+@landau-forte.org.uk$', $email))
return true;
else
return false;
}
He wants a script to validate that an e-mail address HAS been entered.
I.e.
function if_email($email) {
//Define check
$bademail = '\[USERNAME\]';
//Check that [USERNAME] is not contained in e-mail field
if (ereg($bademail . '@^[\w_\.\-]$', $address))
return false;
else if (ereg('^[\w_\.\-]+@[\w\-]+\.[\w\-\.]+$', $address))
return true;
else
return false;
}
that *should* work
HawkeVIPER
Junior Poster in Training
72 posts since Jan 2005
Reputation Points: 10
Solved Threads: 4