I have the following code that when selecting a month, it puts in the $ mes variable, the value selected:
if (isset($_POST['mes']))
{
$mes = $_POST['mes'];
echo "$mes";
}
(isset($_POST["mes"])) ? $mes1 = $_POST["mes"] : $mes1=3;
echo '
<form method="post" action="" name="form">
<select name="mes" id="mes">
<option value="1">Janeiro</option>
<option value="2">Fevereiro</option>
<option value="3">Março</option>
<option value="4">Abril</option>
<option value="5">Maio</option>
<option value="6">Junho</option>
<option value="7">Julho</option>
<option value="8">Agosto</option>
<option value="9">Setembro</option>
<option value="10">Outubro</option>
<option value="11">Novembro</option>
<option value="12">Dezembro</option>
</select>
<input name="submit" type="submit">
</form>
';
But after selecting and working, the select field returns to the first value, in the case of January.
How do I, after selecting and giving ok, the select field is selected the value $ mes?