Hi guys....newbie on the forums here :)
I have developed a php form processor for a project i am working on. I am trying to validate the email address, however i want to add 1 more check the the default script. At the moment i have the following:
function if_email($staff)
{
//Check the valididty of the email address entered
if (ereg('^[a-zA-Z0-9_\.\-]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$', $address))
return true;
else
return false;
}
Which I have taken from a PHP book i am working with. My question is as follows:
The textbox that the $staff variable is linked to has the text "[USERNAME]@landau-forte.org.uk" pre-defined in it. Staff must change the username section for their own. Can someone tell me how to check...if the email has the phrase '[USERNAME]' in it then return it as an error?
Thanks for your help,
JameZ ;)