0
Hello,
My project consists of... having a form with a select. That select has:
<form action='/paypoints.php' method='post' id='coin_form'>
<select name='payer_amount' class='form-control' required>
<option value=''>- Escolher Valor -</option>
<option value='2'>3 Pontos - 2 moedas</option>
<option value='4'>6 Pontos - 4 moedas</option>
<option value='8'>12 Pontos - 8 moedas</option>
<option value='16'>24 Pontos - 16 moedas</option>
<option value='32'>50 Pontos - 32 moedas</option>
</select>
<input type='submit' name='paycoin' class='btn btn-primary-filled btn-left btn-newsletter btn-rounded inside' value='Trocar Moedas'/>
</form>
My plan is to check through Foreach or Other... The requested value, example "15". OK...
I want to. Check the Select and if the value is... 1 it will automatically bsucar 15... If it is 2, will bsucar 25..
Is there any way to accomplish this through Foreach or others...
Code example:
//Se valor for 2
if($ads_selected == 2) {
//realiza algo... para o 2.
}
I’d like to get a while, Foreach sap.. 'Cause I have to keep making the same code for all values... and a single code would save a lot.
It will be easier if you add the HTML code and describe what "automatically fetch" means.
– Woss
I simply want him to check all 2,4,8,16 and 32 Select values, and then check what the request was
– user21312321
It is not very clear, you can give two examples, what happens if the value is 2 and 4?
– Costamilam
ok.. If the value is 2, it asks for 3 points, and so on.
– user21312321
See if these answers can help you;insert link description here
– Wesley Luiz