0
So I need to create a polling system: There are 5 options the best, good, regular, bad, bad questions. If user click on great, good, regular: stores the information and goes back to the index. If user click bad or bad stores information and go to second question enquete1_2.html stores and goes to index again. Information is already being stored in the bank.
<section>
<?php
if(!empty($_GET['id']) && !empty($_GET['valor'])){
$enquete_id = $_GET['id'];
$valor_opcao = $_GET['valor'];
echo'<h1>Opção <i>'.$valor_opcao.'</i> contabilizada com sucesso!</h1>
<h2><a href="index.html">voltar à página inicial</a></h2>
<h2><a href="enquete_info.php?id='.$enquete_id.'">Ver informações da enquete</a></h2>';
}
else
header("location: main.php");
?>
<script type="text/javascript">
valor_opcao = "valor";
if (valor_opcao == "id=1&valor=Ótimo") {
window.location.href = "index.html";
} else if (valor == "id=1&valor=Bom") {
window.location.href = "index.html";
} else if (valor == "id=1&valor=Bom") {
window.location.href = "index.html"; `
`
}else {
window.location.href = "enquete1_2.html";
}
</script>
</div>
</div>
</section>
</div>
Fernando expliqe better what you need. What is the purpose of your code?
– user148170
So I need to create a polling system: There are 5 options the best, good, regular, bad, bad questions. If user click on great, good, regular: stores the information and goes back to the index. If user click bad or bad stores information and go to second question stores and go to index again.
– Fernando Cordeiro
Fernando, it’s not clear
– user148170
So I need to create a polling system: There are 5 options the best, good, regular, bad, bad questions. If user click on great, good, regular: stores the information and goes back to the index. If user click bad or bad stores information and go to second question stores and go to index again.
– Fernando Cordeiro
ok, I get it. Is there more code besides this one? If you’ve edited your question for me to try to help you in a more precise way.
– user148170
It’s not just that.
– Fernando Cordeiro
I’m missing the java script option I believe if I have an example in php I thank tbm.
– Fernando Cordeiro
ok, I’ll build in php and html for you and then you adapt as your need
– user148170
OK thanks in advance
– Fernando Cordeiro