<?php require_once "BancoDeDados/classPerguntas.php"; $con = new perguntas(); //Instancia a class $rs = $con->seleciona(); //Seleciona include 'secure.php'; include 'cabecalho.php'; ################################ ?> <table class = table > <form method="POST" > Cadastro de Perguntas <br><br> Nivel: <input type="text" name="nivel" required><br><br> Pergunta: <input type="text" name="pergunta" required><br><br> Resposta1: <input type="text" name="resposta1" required><br><br> Resposta2: <input type="text" name="resposta2" required><br><br> Resposta3: <input type="text" name="resposta3" required><br><br> Resposta4: <input type="text" name="resposta4" required><br><br> RespostaCerta: <input type="text" name="respostaCerta" required><br><br> <input type="submit" name="submit" value="Salvar"> </form> <?php @($nivel = $_POST["nivel"]); @($pergunta = $_POST["pergunta"]); @($resposta1 = $_POST["resposta1"]); @($resposta2 = $_POST["resposta2"]); @($resposta3 = $_POST["resposta3"]); @($resposta4 = $_POST["resposta4"]); @($respostaCerta = $_POST["respostaCerta"]);
<?php require_once "BancoDeDados/classPerguntas.php"; $con = new perguntas(); //Instancia a class $rs = $con->seleciona(); //Seleciona include 'secure.php'; include 'cabecalho.php'; ################################ ?> <table class = table > <tr > <td ><b>Id</b></td> <td><b>Pergunta</b></td> <td ><b>Resposta 1</b></td> <td ><b>Resposta 2</b></td> <td ><b>Resposta 3</b></td> <td ><b>Resposta 4</b></td> </tr> <?php while ($resultado = mysql_fetch_array($rs)) { $id = $resultado["id"]; ?> <tr> <td><?php echo $id; ?> </td> <td><?php echo $resultado["pergunta"];
<?php require_once "BancoDeDados/classPerguntas.php"; $con = new perguntas(); //Instancia a class $a = $_GET["ID"]; $rs = $con->seleciona($a); //Seleciona $resultado = mysql_fetch_array($rs); include 'secure.php'; include 'cabecalho.php'; ################################ ?> <table class = table > <form method="POST" > Atualização de Cadastro de Perguntas<br><br> Nivel: <input type="text" name="nivel" value="<?php echo $resultado["nivel"]; ?> " required><br><br> Pergunta: <input type="text" name="pergunta" value="<?php echo $resultado["pergunta"]; ?> " required><br><br> Resposta1: <input type="text" name="resposta1" value="<?php echo $resultado["resposta1"]; ?> " required><br><br> Resposta2: <input type="text" name="resposta2" value="<?php echo $resultado["resposta2"]; ?>
<?php require_once "BancoDeDados/classPerguntas.php"; $con = new perguntas(); //Instancia a class $a = $_GET["ID"]; $rs = $con->seleciona($a); //Seleciona $resultado = mysql_fetch_array($rs); include 'secure.php'; include 'cabecalho.php'; ################################ @($exclui = $con->apaga($a)); header("location:listaPerguntas.php"); ?> </table> <?php ################################ include 'footer.php';