Ik heb weer eens een klein scriptje gemaakt voor in jou aanmeld pagina!
Met dit script kan je checken of een email wel een correcte email is!
Demo: http://www.dylanproductions.nl/sander/email.php
Code:
De commentaar heb ik erbij gezet zodat jullie weten voorwat het dient.
Het is een best simpel script maar toch
.
Veel succes
Met dit script kan je checken of een email wel een correcte email is!
Demo: http://www.dylanproductions.nl/sander/email.php
Code:
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #FF8000]/*
*FUNCTIE = Checken of de ingegeven email wel een correcte email is
*Auteur = Sander C.
*Laatste Update = 23/06/2012
*/[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SERVER[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]REQUEST_METHOD[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]POST[/COLOR][COLOR= #007700]){[/COLOR]
[COLOR= #FF8000]//Checken of er een apenstaartje staat in de email[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][URL="http://www.php.net/stristr"]stristr[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]email[/COLOR][COLOR= #007700]],[/COLOR] [COLOR= #DD0000]@[/COLOR][COLOR= #007700]) ===[/COLOR] false[COLOR= #007700]){[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]Er staat geen apenstaartje in je e-mail, dus het is geen e-mail. Je bent niet door de controle![/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #FF8000]//Checken of er wel een punt staat in de email (voor .com etc.) [/COLOR]
[COLOR= #007700]}[/COLOR][URL="http://www.php.net/elseif"]elseif[/URL] [COLOR= #007700]([/COLOR][URL="http://www.php.net/stristr"]stristr[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]email[/COLOR][COLOR= #007700]],[/COLOR] [COLOR= #DD0000].[/COLOR][COLOR= #007700]) ===[/COLOR] false[COLOR= #007700]){[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]Er staat geen [/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000] in je e-mail. Dat betekent dat je email vanachter geen extenstie heeft[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #FF8000]//Checken of de email zeker 8 karakters heeft, want k@i.p kan niet echt bestaan ;)[/COLOR]
[COLOR= #007700]}[/COLOR][URL="http://www.php.net/elseif"]elseif[/URL] [COLOR= #007700]([/COLOR][URL="http://www.php.net/strlen"]strlen[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]email[/COLOR][COLOR= #007700]]) <[/COLOR] [COLOR= #0000BB]8[/COLOR][COLOR= #007700]){[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]Je e-mail is te kort om een e-mail te kunnen zijn![/COLOR][COLOR= #007700];
}[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000] In orde[/COLOR][COLOR= #007700];
}
}[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
?>
<form method=post action=#>
<input type="text" name="email">
<input type="submit" value="Check">
</form>
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #007700]}[/COLOR]
?> De commentaar heb ik erbij gezet zodat jullie weten voorwat het dient.
Het is een best simpel script maar toch
.Veel succes

