0
Here’s the thing... I’m creating a kind of quiz where the player has to deduct the answer and put it into the input. If it is correct it is redirected to the next level, if it is wrong it is still on the page and a message is displayed saying that it is not correct. At least that’s the idea kkk. The problem is that the message that is to appear only when the player misses is appearing while loading the page, without even having put the answer in the input, understand? How can I fix it?!!! Ah, yes... It’s my first time posting a question, forgive lack of objectivity or the like.
Nocase | Level 1
<?php include("includes/fra.php"); ?>
<div id="wrapper">
<!-- CAPTURANDO A RESPOSTA -->
<?php $resposta = isset($_POST["massive"])?$_POST["massive"]:"none";?>
<div class="text-center">
<p style="font-size: 22pt;">1¹</p>
<form action="#wrapper" id="mass" method="POST">
<input type="text" class="form-control" autocomplete="off" name="massive" id="massive" placeholder="RESPOSTA">
</form>
<!-- TÁ PRINTANDO AO CARREGAR A PÁGINA E NÃO QUANDO O USUÁRIO ERRA-->
<?php $resposta != 1?print $frases[$rand_keys]: header("Location:example.com");?>
<button form="mass" type="submit" class="damn_botao"><span class="glyphicon glyphicon-ok" aria-hidden="true"></span></button>
</div>
</div>