Here's a script I've made
The script checks if the mail looks like a valid one
<?
if (checkmail($mail)) {
print("Adresse correcte");
} else {
print("Adresse invalide");
}
function checkmail($mail){
$mail2 = trim($mail);
$lg=strlen($mail2);
$pos1=strrpos($mail2,".");
$pos2=strrpos($mail2,"@");
if(ereg("@",$mail2) and $pos1>$pos2 and $lg>5 and $pos2>=1)
{
if (ereg(" ",$mail2)) {
return false;
} else {
return true;
}
}
else
{
return false;
}
}
?>
__________________________________________________________________
WADIN JULIEN
URL : www.campinfm.be.tf
-----Message d'origine-----
De : -{ Rene Brehmer }- [mailto:[EMAIL PROTECTED]
Envoy� : jeudi 13 mars 2003 16:13
� : Philip J. Newman; [EMAIL PROTECTED]
Objet : Re: [PHP] Checking for a Valid Email String.
On Wed, 12 Mar 2003 14:49:11 +1300, Philip J. Newman wrote about "Re:
[PHP] Checking for a Valid Email String." what the universal translator
turned into this:
>You have used the ' in sted of the " i assume that there is no difference?
The difference is that when you use ", PHP looks for variables to be
filled in. With ' it doesn't...
I can't produce the correct results with ' though. Maybe it's because I'm
too used at basic and JS ... PHP is a tad different...
Rene
--
Rene Brehmer
This message was written on 100% recycled spam.
Come see! My brand new site is now online!
http://www.metalbunny.net
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php