3
I have this great quiz, inside a modal that when I click the record button, the button does not redirect to the page I want. The Error is not of the page registrar.php
because I had put a simple alert
in it, and it didn’t work, besides when I click the button nothing happens. This worked once, but it stopped working for no reason. If anyone finds any mistakes I appreciate it, I’m already hours away trying to find.
<!-- Modal -->
<div class="modal fade" id="myModal" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header" style="background-color:#0066cc; color:#FFF;">
<button type="button" class="close" data-dismiss="modal">×</button>
<h1 class="modal-title">Registrar Aluno</h1>
</div>
<div class="modal-body" style="font-size:20px;">
<form action="registrar.php" method="POST">
<p> <i class="fa fa-credit-card fa-lg" aria-hidden="true"></i>
<input type="text" tabindex="1" name="n_processo" required placeholder="Nº Processo" maxlength="5" id="n_processo" style="font-size:18px; width:150px; border:1px solid #cccccc; padding-left:5px; border-radius: 5px;"> </p>
<br>
<p> <i class="fa fa-user fa-lg" aria-hidden="true"></i>
<input type="text" placeholder="Nome" onkeypress="return letras()" tabindex="2" name="nome" id="nome" required maxlength="150" style="font-size:18px; width:400px;border:1px solid #cccccc; padding-left:5px; border-radius: 5px;"> </p>
<br>
<p> <i class="fa fa-calendar fa-lg" aria-hidden="true"></i>
<select tabindex="3" name="dia" required>
<option disabled selected hidden value="">Dia</option>
<?
for($dia = 1; $dia <= 31; $dia++)
{
if($dia < 10) {
echo "<option>0$dia</option>";
}else
{
echo "<option>$dia</option>";
}
}
?>
</select>
<select tabindex="4" name="mes" required>
<option disabled selected hidden value="">Mês</option>
<?
for($mes = 1; $mes <= 12; $mes++)
{
if($mes < 10)
{
echo "<option>0$mes</option>";
}
else
{
echo "<option>$mes</option>";
}
}
?>
</select>
<select tabindex="5" name="ano" required>
<option disabled selected hidden value="">Ano</option>
<?
$hoje = date("Y");
for($ano = ($hoje-30); $ano <= ($hoje-14); $ano++)
{
echo "<option>$ano</option>";
}
?>
</select><br>
<font style="font-size: 15px;color:gray;font-style: italic;">Data de Nascimento</font>
</p>
<br>
<p> <i class="fa fa-university fa-lg" aria-hidden="true"></i>
<input type="text" tabindex="6" name="cc" id="cc" required maxlength="9" style="font-size:18px; width:100px; border:1px solid #cccccc; padding-left:5px; border-radius: 5px;text-align: center;">
-
<input type="text" tabindex="7" name="zz" id="zz" required maxlength="4" style="font-size:18px; width:70px; border:1px solid #cccccc; padding-left:5px; border-radius: 5px; text-transform: uppercase;text-align: center;">
<br>
<font style="font-size: 15px;color:gray;font-style: italic;">Cartão de Cidadão</font>
</p>
<br>
<!-- <p style="background-color: rgba(240, 11, 18, 0.8); border-radius: 5px; padding-left: 10px; padding-top: 5px;padding-bottom: 5px; font-size: 15px;">Cuidado! Os próximos campos, depois de criados não podem ser editados!</p> -->
<!-- -----------------------------CURSO------------------------------------------------- -->
<p><i class="fa fa-question-circle fa-lg" aria-hidden="true"></i>
<select tabindex="8" name="escolhe" id="tipo_curso" onchange="mostrar()" required="">
<option disabled selected hidden value="">Tipo do Curso</option>
<option>Profissional</option>
<option>Vocacional</option>
</select>
</p>
<br>
<!-- -----------------------------------DIV 1 ------------------------------------- -->
<div style="display: none;" id="curso_um">
<p> <i class="fa fa-graduation-cap fa-lg" aria-hidden="true"></i>
<select name='cursos1' required tabindex="9">
<option disabled selected hidden value="">Curso</option>
<?
$sql = "SELECT designacao FROM cursos WHERE id_tipo_curso = 1";
$resposta = mysql_query($sql,$conexao);
while ($row = mysql_fetch_array($resposta))
{
$sql = "SELECT designacao FROM cursos WHERE ";
echo "<option value='" . $row['designacao'] ."'> ".$row['designacao']."</option>";
}
?>
</select>
</p>
<br>
<P><i class="fa fa-clock-o fa-lg" aria-hidden="true"></i>
<input type="text" name="ciclo" id="ciclo" tabindex="10" maxlength="4" placeholder="2010" style="border:1px solid #cccccc; font-size:18px; letter-spacing: 2px; width:100px;border-radius: 5px; text-align: center;" onkeyup="tenta()" required>
-
<input type="text" name="ciclo2" id="lol" tabindex="11" placeholder="2013" readonly style="border:1px solid #cccccc; font-size:18px; letter-spacing: 2px; width:100px;border-radius: 5px; text-align: center;">
<br>
<font style="font-size: 15px;color:gray;font-style: italic;">Ciclo de Formação</font>
</P>
</div>
<!-- -----------------------------------DIV 2 ------------------------------------- -->
<div style="display: none;" id="curso_dois">
<p> <i class="fa fa-graduation-cap fa-lg" aria-hidden="true"></i>
<select name='cursos2' required tabindex="9">
<?
$sql = "SELECT designacao FROM cursos WHERE id_tipo_curso = 2";
$resposta = mysql_query($sql,$conexao);
while ($row = mysql_fetch_array($resposta))
{
$sql = "SELECT designacao FROM cursos WHERE ";
echo "<option value='" . $row['designacao'] ."'> ".$row['designacao']."</option>";
}
?>
</select>
</p>
<br>
<P><i class="fa fa-clock-o fa-lg" aria-hidden="true"></i>
<input type="text" name="ciclo3" id="ciclo3" tabindex="10" maxlength="4" placeholder="2010" style="border:1px solid #cccccc; font-size:18px; letter-spacing: 2px; width:100px;border-radius: 5px; text-align: center;" onkeyup="numeros2()" required>
-
<input type="text" name="ciclo4" id="ciclo4" tabindex="11" placeholder="2012" readonly style="border:1px solid #cccccc; font-size:18px; letter-spacing: 2px; width:100px;border-radius: 5px; text-align: center;">
<br>
<font style="font-size: 15px;color:gray;font-style: italic;">Cartão de Cidadão</font>
</P>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-primary"><i class="fa fa-floppy-o fa-2x"></i></button>
<button type="button" class="btn btn-default" data-dismiss="modal"><i class="fa fa-times fa-2x"></i></button>
</div>
</form>
</div>
</div>
</div>
</div>
What is the severity of the ? , E_ERROR, E_NOTICE or E_WARNING error
– Edx
What do you mean @Edx ? I’ve never used this kind of
error_reporting
. But the error is only that when you click on the Submit button, nothing happens.– programmer2016
I believe that the answer below Renan is what you need, I think he killed 'Charada', if you want to delve into "error_reporting" look at the PHP Link the right way http://br.phptherightway.com/#erros_e_exceptions, I hope I helped
– Edx