I have a $posicoes
variable that receives the amount of elements that exist in the replies session:
$posicoes = count($_SESSION['respostas']);
if ($_GET['idQuestao'] > $posicoes) {
// acontece isso...
} else {
$voltaQuestao = $idQuestao + 1;
header("Location: questao.php?idQuestao=" . $voltaQuestao);
}
Dai keeps appearing this message every time the variable positions is 0
Notice: Undefined index: answers in C: \ wamp \ www \ quiz \ questao.php on line 23
Line 23 is this: GET
And I need to do this check, it has to start with 0 anyway. Does the error message appear when the variable positions is greater than or equal to 1 ?