IST - Física
Programação
HTML - Exemplos 12:03:40
28 - Mar - 2024
Google Wikipedia Download Manuais: HTML5 CSS PHP
Faça os seus comentários

Classificação
  • Muito bem
  • Bem
  • Assim assim
  • Mal
  • Muito mal


Nome:


Código de escrita:

<?php
$ch_estado_values = array ('Assim assim', 'Muito bem', 'Bem', 'Assim assim', 'Mal', 'Muito mal');
$nome = $_REQUEST['NOME'] ;
$texto = $_REQUEST['TEXT'] ;
$estado = $_REQUEST['ESTADO'] ;
if (($estado < 1) || ($estado > 5)) $estado = 3;
$chestado = $ch_estado_values[$estado];
?>

<div style="border-top: 8px solid #fff;">
<form action="HtmlEx_017_Forms.php" method="POST" enctype="application/x-www-form-urlencoded">

<table id="FormTable">
<tr><td width="100%" colspan="2" ><font size=+2><b>Faça os seus comentários</b></font><br><hr></td></tr>
<tr><td width="100%">

<table id="FormTableTArea">
<tr><table id="FormTableTArea1"><tr>
<td width="80%" align=left>
<textarea id="FormTextArea" name="TEXT" cols="40" rows="9"
<?php if ($nome) {printf ("readonly value=\"%s\"", $nome);} ?> >
<?php if (strlen($nome) > 0) {
  printf ("A classificação de %s foi '%s'.\n", $nome, $chestado);
  printf ("O seu comentário foi:\n%s", $texto);
}
?>
</textarea></td></tr>
</table>

</td>
<td>
<table id= WIDTH="100%" HEIGHT="100%" BORDER="1" CELLPADDING="4" CELLSPACING="0">
<tr><td WIDTH="100%" HEIGHT="100%" ALIGN=CENTER style="vertical-align: top; ">
<font size=+1><b>Classificação</b></font><br>
<ul style="text-indent: -20px; text-align: left; list-style-type: none;">
<li><input type="radio" name="ESTADO" value="1" 
    <?php if ($estado == 1) print ("checked "); ?> >Muito bem<br>
<li><input type="radio" name="ESTADO" value="2" 
    <?php if ($estado == 2) print ("checked"); ?> >Bem<br>
<li><input type="radio" name="ESTADO" value="3" 
    <?php if ($estado == 3) print ("checked"); ?> >Assim assim<br>
<li><input type="radio" name="ESTADO" value="4" 
    <?php if ($estado == 4) print ("checked"); ?> >Mal<br>
<li><input type="radio" name="ESTADO" value="5" 
    <?php if ($estado == 5) print ("checked"); ?> >Muito mal<br>
</ul>
</td></tr>
<tr style="vertical-align: bottom;">
<td>
<table style="width: 100%; height: 100%; border: 0; cellpadding: 4px; cellspacing: 0;">
<tr>
<td width="50%" style=" align: left;">
<input type="submit" value="Submeter" <?php if ($nome) {printf (" disabled ");} ?> ></td>
<td width="50%" style=" align: right;">
<input type="reset" value="Limpar" <?php if ($nome) {printf (" disabled ");} ?> ></td>
</tr>
</table>
</td></tr>
</table>

</td></tr>
<td colspan="2">
<br><hr>
<b>Nome:</b> <input id="FormTextInputNome" name="NOME" type="text" size="55" maxlength="200"
<?php if ($nome) {printf ("readonly value=\"%s\"", $nome);} ?> >
</td></tr></table>
</td>
<td width="20">
</td></tr>
</table>

</p></form></div>