I'm having a little trouble with a code I'd like to implement into a script. I've looked around and found some answers, but not really a complete answer to what I was looking for. What I'd like to do is only allow people whose e-mail address matches a certain pattern to be able to create an account. Now I know the code is suppose to go something like this:
function checkEmail($email) {
if (!preg_match("/( [a-zA-Z0-9] )+( [a-zA-Z0-9.-] )*@( [a-zA-Z0-9-] )+( [a-zA-Z0-9._-] +)+$/" , $email)) {
return false;
}
return true;
}
I thought that by changing the line to say something like:
if (!preg_match("/( [a-zA-Z0-9] )+( [a-zA-Z0-9._-] )*@(domain.com)" , $email)) {
might work, but I'm not sure...
But the main problem I have is that I don't know where to implement the code into the script that I have. If those who desire to aid me in my distress would be so kind as to check the code in this zip file: ZIP. The file is also attached to this post. So whatever.
This is for the my own mediawiki project. Thanks for the help.