PHP: Comment traiter le champs ‘hidden’ d’un formulaire

Author:

 formulaire
Download

<?php
if (isset($_POST['_voir_soumission']))
{
    afficher_msg();
}
else
{
    afficher_formulaire();
}
 
function afficher_msg() {
    print "<strong/>Bienvenu, ". $_POST['nom'];
}
 
function afficher_formulaire()
{
    print<<<_HTML_
<form action="$_SERVER[PHP_SELF]" method="post">
Tapez votre nom:
<input type="text" name="nom">
<br/>
<input type="submit" value="Envoyer">
<input type="hidden" name="_voir_soumission" value="1">
</form>
 
_HTML_;
}
?>

Leave a Reply

Your email address will not be published. Required fields are marked *


7 − four =