1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
function verif_form($nom, $prenom, $adresse, $cp, $ville, $tel, $email, $message) {
if(!$nom || !$prenom || !$cp || $cp || !$email || !$message):
print("<h3>Merci de bien vouloir remplir les champs obligatoires.</h3>");
if (!$nom) {
print("Indiquez votre <b>Nom</b>.<br>"); }
if (!$prenom) {
print("Indiquez votre <b>Prénom</b>.<br>"); }
if (!$cp) {
print("Indiquez votre <b>Code postal</b>.<br>"); }
if (!eregi("^([0-9]{5})$", $cp)) {
print("Indiquez un cp <b>correct</b>.<br>"); }
if (!$email) {
print("Indiquez votre <b>Email</b>.<br>"); }
if (!$message) {
print("Indiquez votre <b>Message</b>.<br>"); }
imprimer_form($nom, $prenom, $adresse, $cp, $ville, $tel, $email, $message);
else:
confirmer_form($nom, $prenom, $adresse, $cp, $ville, $tel, $email, $message);
endif;
} |
Partager