Powered by Ajaxy
Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

PHP: Gestion des boutons radio d’un formulaire

 formulaire
{filelink=12523}

<html>
 
 <head>
 
 </head>
 
 <body>
<form action="traiRadio.php" method="post">
   <b>Entrez votre nom:</b>
<input type="text" size="45" name="username">
   <b>Sexe:</b> 
<input type="radio" name="sex" value="M">  Masculin
<input type="radio" name="sex" value="F">   Féminin
   <b>Votre email:</b>
<input type="text" size="45" name="email">
<input type="submit" value="Envoyer">
 </form>
 
 </body>
 
</html>
 
<!--
Créer fichier: traiRadio.php
----------------------Script---------------------------
 
<html>
 <head>
 
 </head>
 <body>
 
 
 <?php
  $username = $_POST['username'];
  $sexe =    $_POST['sex'];
  $email =     $_POST['email'];
 
  if( $username != null )
  {
    echo( "<strong>Merci $username</strong>
<hr />" );
  }
 
   echo "Validez vos informations<br/>";
  if( ( $sexe != null ) &#038;& ( $email != null ) )
  {
    $msg = "Sexe: </b>$sexe</b> ";
    $msg .="Email: </b>$email</b> ";
    echo( $msg );
  }
 ?>
 
 </body>
</html>
-->

No comments yet.

Leave a Comment