1
I am making a form in PHP, when it captures the data of a select it returns me only as 0 or 1, I would like it to show what the selected person:
<select class="form-control" name="pergunta1" required>
<option selected="" value="">ESCOLHA SUA RESPOSTA</option>
<option value="camuflado">CAMUFLADO</option>
<option value="gancho">GANCHO</option>
<option value="estimulante">ESTIMULANTE</option>
<option value="lamina">LÂMINA SÔNICA</option>
<option value="holopiloto">HOLOPILOTO</option>
<option value="escudo">ESCUDO</option>
<option value="cronossalto">CRONOSSALTO</option>
</select>
<?php
$resposta1 = isset($_GET['pergunta1'])?isset($_GET['pergunta1']):0;
$resposta2 = isset($_GET['pergunta2'])?isset($_GET['pergunta2']):0;
echo "$resposta1";
?>
When it returns echo it returns as 1 or 0, I would like it to return as string, for example if the person selected "camouflaged" q returns "camouflaged" instead of 1 or 0.
How about:
$resposta1 = isset($_GET['pergunta1'])?$_GET['pergunta1']:0;
?– Miguel
mmmuuuuuiittooooo thanks, I’m too new still, I’m catching a lot. ma vlww
– Daniel Fortunato
You’re welcome, good luck
– Miguel
and if I need to compare this value with if Else?? for example: <? php $resposta1 = isset($_GET['question1'])?($_GET['question1']): 0; $resposta2 = isset($_GET['Pergunta2'])?($_GET['Pergunta2']): 0; if($answer1 = HOW TO PLACE HERE VALUE "CAMOUFLAGED"?){ echo "camouflaged"; } Else;?>
– Daniel Fortunato
leaves, I got here rsrsr
– Daniel Fortunato