' . _("Your message has been sent!") . '

' . _("Back to the homepage of ") . ' ' . NOMAPPLICATION . '.

'."\n"; bandeau_pied(); session_unset(); } else { $post_var = array('question', 'nom', 'adresse_mail', ); foreach ($post_var as $var) { if (isset($_POST[$var]) && !empty($_POST[$var])) { $_SESSION[$var] = $_POST[$var]; } else { $_SESSION[$var] = null; } } /* * Préparation des messages d'erreur */ $errors = array( 'name' => array ( 'msg' => '', 'aria' => '', 'class' => '' ), 'email' => array ( 'msg' => '', 'aria' => '', 'class' => '' ), 'question' => array ( 'msg' => '', 'aria' => '', 'class' => '' ), 'state' => false ); if (isset($_POST['envoiquestion']) && $_SESSION["nom"]=="") { $errors['name']['aria'] = 'aria-describeby="#poll_name_error" '; $errors['name']['class'] = ' has-error'; $errors['name']['msg'] = '

'. _("Enter a name") .'

'; $errors['state'] = true; } if (isset($_POST['envoiquestion']) && ($_SESSION["adresse_mail"] =="" || !Utils::isValidEmail($_SESSION["adresse_mail"]))) { $errors['email']['aria'] = 'aria-describeby="#poll_email_error" '; $errors['email']['class'] = ' has-error'; $errors['email']['msg'] = '

'. _("The address is not correct!") .'

'; $errors['state'] = true; } if (isset($_POST['envoiquestion']) && $_SESSION["question"]=="") { $errors['question']['aria'] = 'aria-describeby="#poll_question_error" '; $errors['question']['class'] = ' has-error'; $errors['question']['msg'] = '

'. _("You must ask a question!") .'

'; $errors['state'] = true; } //affichage de la page if($errors['state']) { Utils::print_header( _("Error!").' - '._("Contact us") ); } else { Utils::print_header( _("Contact us") ); } bandeau_titre(_("Contact us")); echo '

' . _("If you have questions, you can send a message here.") . '

'.$errors['name']['msg'].'
'.$errors['email']['msg'].'
'.$errors['question']['msg'].'

'."\n"; bandeau_pied(); }