martes, 9 de octubre de 2012

Notepad++
<?
if(!$_POST) {
?>
<table border="0" width="600" align="center">
<form action="<? $_POST ?>" method="post">
   <tr>
                <td colspan="2"><h1 align="center">examen</h1></td>
                                  </tr>
                                 <tr>
                                 <td align="right">nombre:</td>
                                 <td>
                                     <input type="text" required name=nombre" maxlength="100" size="40" />
                                                
                                 </td>
      </tr>
                  <tr>
                       <td align="right"> ¿cuanto es 3+2?</td>
                                  <td>
                                     <select name="p1">
                                                 <option value="1">6</option>
                                                 <option value="2">5</option>
                                                 <option value="3">8</option>
                                                 <option value="4">4</option>
                      </select>
                               </td>
                  </tr>
                  <tr>
                       <td colspan="2">
                                     <input type="submit" value="procesar"/>
                                                 <tr> 
</form> 
</table>

<?
}else{
$nombre = $_post ['nombre'];
$p1 = $_post ['p1'];

if($p1 == 2) {
    echo "respuesta correcta";
} else {
   echo "respuesta incorrecta";
}
}
?>

No hay comentarios:

Publicar un comentario