0
I have a code from a select field and I need it to be dynamically in an array the option selected by the user. Every time the user starts the page the selected option appears. Follows the code:
<?php
header("content-type: text/html; charset=utf-8");
$cursos=array('JAVA','PHP','Python');
?>
</html>
<select value="teste">
<option value="">Selecione</option>
<?php
foreach($cursos as $curso) {
?>
<option value="<?php echo $curso;?>"<?php ?>><?php echo $curso;?></option>
<?php
}
?>
</select>
This $CURSO_DO_USUARIO variable has to receive the array if selected, Selected will appear on the screen of the selected option.
– IvanFloripa