Jump to content

sh89

New Members
  • Posts

    3
  • Joined

  • Last visited

sh89's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. This is what I've come up with, but I still have the issue of it checking the last item in the array and not the button that was selected: <?php //Creating foreach loop for magazine selection foreach ($magSubs as $mag => $SUB_PRICE) { echo "<input type='radio' name='magtype' value='$mag' "; if (isset($_GET['magtype'])) { echo "checked='checked'"; } echo " >$mag $$SUB_PRICE per month<br>"; } ?>
  2. I tried that, but unfortunately all that does is check the last item in the array. I also tried that with if isset, to no avail.
  3. Hello all. I have tried to figure out why I can't make a certain part of my code sticky. I am attempting to save the user's input for the radio button section. I am using a foreach loop for everything in my array. When I try to use if isset, it returns the last item in the array instead of what was selected by the user. Here is the code: <?php //Creating foreach loop for magazine selection foreach ($magSubs as $mag => $SUB_PRICE) { echo "<input type='radio' name='magtype' value='$mag' />$mag $$SUB_PRICE per month<br> "; } ?> Again, I want to make this part sticky.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.