What could be wrong? Do not insert anything into the bank.
Form:
<form class="form-horizontal" action="chk-gerente.php?nro_pergunta=<?php echo $nro_pergunta; ?>" method="GET">
<fieldset>
<legend><b>Pergunta <?php echo"$ordem";?> de <?php echo"$totalpergunta";?></b></legend>
<div class="form-group">
<center><h3><label><?php echo"$descpergunta";?></label></h3></center>
<div class="col-lg-10">
<div class="radio"><label><input type="radio" name="resp" id="optionsRadios1" value="5">OTIMO </label></div>
<div class="radio"><label><input type="radio" name="resp" id="optionsRadios2" value="3">REGULAR </label></div>
<div class="radio"><label><input type="radio" name="resp" id="optionsRadios3" value="1">RUIM </label></div>
<div class="radio"><label><input type="radio" name="resp" id="optionsRadios4" value="0">NAO APLICADO </label></div>
</div>
</div>
<?php
$timestamp = @mktime(date("H")-4, date("i"),date("s"),date("m"),date("d"),date("Y"),0);
$DataCad = gmdate("Y-m-d", $timestamp); // Gravar $DataCad no BD
echo"<input type='hidden' name='loja' id='loja' value='$loja'>";
echo"<input type='hidden' name='id_usuario' id='id_usuario' value='$id_usuario'>";
echo"<input type='hidden' name='questionario' id='questionario' value='$questionario'>";
echo"<input type='hidden' name='area' id='area' value='$area'>";
echo"<input type='hidden' name='nro_pergunta' id='nro_pergunta' value='$nro_pergunta'>";
echo"<input type='hidden' name='DataCad' id='DataCad' value='$DataCad'>";
echo"<input type='hidden' name='pergunta' id='pergunta' value='$idpergunta'>";
?>
<div class="form-group">
<div class="col-lg-10 col-lg-offset-2">
<button id='button' type="submit" class="btn btn-primary">Responder</button>
</div>
</div>
</fieldset>
</form>
INSERT
is at the top of the page:
require("conexao.php");
if(isset($_GET['submit'])){
$loja = $_GET ["loja"];
$id_ususario = $_GET ["id_usuario"];
$questionario = $_GET ["questionario"];
$area = $_GET ["area"];
$idpergunta = $_GET ["pergunta"];
$resp = $_GET ["resp"];
$datacad = $_GET ["DataCad"];
$sql_insert = mysql_query("INSERT INTO respostas
(resp_id,resp_loja,resp_usuario,resp_questionario,resp_area,resp_subgrupo,resp_pergunta_id,resp_resposta,resp_data,resp_status)
VALUES
('','$loja','$id_usuario','$questionario','$area','1','$idpergunta','$resp','$DataCad','1')")
or die (mysql_error());
@mysql_query($sql_insert,$conexao);
} else {
}
I tried to pass that way too and it was not ...
include("conexao.php");
if(isset($_GET['submit'])){
$loja = $_GET ["loja"];
$id_ususario = $_GET ["id_usuario"];
$questionario = $_GET ["questionario"];
$area = $_GET ["area"];
$idpergunta = $_GET ["pergunta"];
$resp = $_GET ["resp"];
$datacad = $_GET ["DataCad"];
$sql=" INSERT INTO respostas
(resp_id,resp_loja,resp_usuario,resp_questionario,resp_area,resp_subgrupo,resp_pergunta_id,resp_resposta,resp_data,resp_status)
VALUES
('','$loja','$id_usuario','$questionario','$area','1','$idpergunta','$resp','$DataCad','1'";
} else {
}