I'm fairly new to php, and coding in general.
I have a site where I will be having a horse trained. In the sql database I have a variable for how much they've been tamed, and when it's 100 it will stop. But the user can select from a drop down menu how long they'd like to tame the horse from 30 mins-4 hours. Each full hour is a full point towards the taming and a half point is worth .5. I want another variable that decreases the energy. For every 30 minutes it would decrease the energy by 5%. So I'd multiply whatever they chose by 10.
How do I get it to where it knows what the user selects and to then use that as what's updated in the value field?
This is the code I have:
<form id="Update" name="Update" method="POST" action="<?php echo $editFormAction; ?>">
<input type="submit" name="Tame" id="Tame" value="Tame" />
<select name="Hours">
<option value=".5">30 mins</option>
<option value="1">1 hour</option>
<option value="1.5">1 hour 30 mins</option>
<option value="2">2 hours</option>
<option value="2.5">2 hours 30 mins</option>
<option value="3">3 hours</option>
<option value="3.5">3 hours 30 mins</option>
<option value="4">4 hours</option>
</select>
<input name = "Energy" type = "hidden" id = "EnergyDown" value = ""
<input name="Date" type = "hidden" id = "Date" value= "<?php echo $RealDate ?>"/>
<input type="hidden" name="MM_update" value="Update" />
<input name="HorseId" type="hidden" id="HorseId" value="<?php echo $colname_HorseInfo ?> ">
</form>