I have a form in which the user can select several materials, and then a subject is selected, through PHP I will pull the database by SELECT
and I will show on the screen with echo
results.
My code:
<form id = "questions_form" method= "post">
<select class= "box-select" name="select1">
<option value="value1">Estrutura de Banco de Dados</option>
</select>
<input type="submit" name="submit" value="Resultado"/>
<div class = "resultados-lista">
<?php
$query = "SELECT def_conteudo FROM conteudo WHERE nome_conteudo = 'Estrutura de Banco de Dados' ";
$result = mysqli_query($con,$query);
if(isset($_POST['select1'])){
$select1 = $_POST['select1'];
switch ($select1) {
case 'value1':
echo "<li>" . $fetch[0] . "</li>";
break;
default:
# código
break;
}
}
?>
</div>
</form>
</div>
</div>
But because many of the subjects have more than 30 questions, it is very bad and unfeasible that they be shown on the same page. Because of this, I'd like to give target
on a new page just to show these questions. But I do not know how I can do this.