I made a little PHP script that checks if an email is valid. The only problem is that it doesn't check if the dot is BEHIND the '@'. It accept emails like this: Hi.Hello@hotmailcom when it should only accept emails like HiHello@hotmail.com
This is my script:
<?php
$mail = $_POST['mail'];
    function checkmail($mail)
        {
            if ((strpos ($mail, '@') !== false) && (strpos ($mail, ".") !==false))
            {                   
                return true;
            }
            else
            {
                return false;
            }
        }
if(checkmail($mail))    
{
echo"Goed"; 
}   
else    
{       
echo"Fout";     
}
?>
Thanks in advance!
 
     
     
     
     
    