Jump to content

Recommended Posts

somewhere in here is some syntax error....can you help me find it?  I cant seem to find it:

<?php }
?>

<?php foreach($_POST["product"] AS $key => $val) {
$product = $val;?>
<form id="form1" action="#">

<fieldset class="radio">
   <legend>Does <?php echo $val; ?> need to be ordered?</legend>
  <legend>
<label for="rad1"><input type="radio" name="demo_radio<?php echo $val; ?>" id="rad1<?php echo $val; ?>" value="yes"
  > Yes</label><br>

  <label for="rad2"><input type="radio" name="demo_radio<?php echo $val; ?>" id="rad2<?php echo $val; ?>" value="no"
  > No</label>
  <div class="label" id="demo_radio_ta_label<?php echo $val; ?>"> <?php if ((strpos($val,'Sparring') || strpos($val,'Feet')) !== false){
    ?>
    <form action="" method="post" class="sub"><input name="item" type="hidden" value="Sparring Feet: size" />
  <select name="item1">
    <option value="Child 12/13">Child 12/13</option>
    <option value="1/2">1/2</option>
    <option value="3/4">3/4</option>
    <option value="5/6">5/6</option>
    <option value="7/8">7/8</option>
    <option value="9/10">9/10</option>
    <option value="11/12">11/12</option>
    <option value="13/14">13/14</option>
  </select>
  <input name="submit" type="submit" value="submit" />
  </form>
  <?php } else if ((strpos($val,'Sparring') || strpos($val,'Hands')) !== false){
    ?>
        <form action="" method="post" class="sub">

    <input name="item1" type="hidden" value="Sparring Hands...shoe size: " />
please enter shoe size(hands are based on shoe size) <input name="hands" type="text" />
   <input name="submit" type="submit" value="submit" />

</form>
  <?php } else if ((strpos($val,'Sparring') || strpos($val,'Shins')) !== false){
    ?>
        <form action="" method="post" class="sub">
    <input name="item" type="hidden" value="Sparring shins...shoe size:" />
  please enter shoe size(shins are based on shoe size) <input name="item1" type="text" />
    <input name="submit" type="submit" value="submit" />
</form>
  <?php } else if ((strpos($val,'Sparring') || strpos($val,'head')) !== false){
    ?>
        <form action="" method="post" class="sub">
    <input name="item" type="hidden" value="Sparring Head: size" />
    please keep in mind most people are XL
  <select name="item1">
    <option value="Small">Small</option>
    <option value="Medium">Medium/Lg</option>
    <option value="Large">X-Large</option>
  </select>
    <input name="submit" type="submit" value="submit" />
</form>
  <?php } else if ((strpos($val,'Sparring') || strpos($val,'Elbow Pads')) !== false){
    ?>
        <form action="" method="post" class="sub">

    <input name="item" type="hidden" value="elbow pads" />
     <input name="submit" type="submit" value="submit" />
</form>
  <?php } else if ((strpos($val,'Sparring') || strpos($val,'Groin Protector')) !== false){
    ?>
        <form action="" method="post" class="sub">
<input name="item" type="hidden" value="Groin protector size: " />
  <select name="item1">
    <option value='Child Cup Sm (20"-26")'>Child Cup Sm (20"-26")</option>
    <option value='Child Cup Lrg (26"-32")'>Child Cup Lrg (26"-32")</option>
    <option value='Adult Small (26"-32")'>Adult Small (26"-32")</option>
    <option value='Adult Medium (32"-38")'>Adult Medium (32"-38")</option>
    <option value='Adult Large (38"-44")'>Adult Large (38"-44")</option>
    <option value='Adult X-Large (44"-50")'>Adult X-Large (44"-50")</option>
  </select>
   <input name="submit" type="submit" value="submit" />
</form>
  <?php } else if ((strpos($val,'ECAS') || strpos($val,'Gear')) !== false){
    ?>
        <form action="" method="post" class="sub"><input name="item" type="hidden" value="Ecas Gear size " />

    Shin/elbow
  <select name="shin/elbow">
    <option value="Small">Small</option>
    <option value="Medium">Medium</option>
    <option value="Large">Large</option>
    <option value="X-Large">X-Large</option>
  </select> Shin/elbow
  <select name="glove">
    <option value="Sm/Med">Sm/Med</option>
    <option value="Lg/Xl">Lg/Xl</option>
  
  </select>
   <input name="submit" type="submit" value="submit" />
</form>
  <?php }  ?> </div>
  </legend>
</fieldset>
</form>
<?php }
?>

Link to comment
https://forums.phpfreaks.com/topic/257796-syntax/
Share on other sites

it has something to do with the fieldset............it is thinking it is outside of a form, even though it is inside the form.  how do I fix this?

<?php foreach($_POST["product"] AS $key => $val) {
$product = $val;?>
<form id="form1<?php echo $val;?>" action="#">

   <fieldset><legend>Does <?php echo $val; ?> need to be ordered?</legend>
  <legend>
  <label for="rad1">
<input type="radio" name="demo_radio<?php echo $val;?>" id="rad1<?php echo $val; ?>" value="yes">Yes</label>
<br/>
<label for="rad2"><input type="radio" name='demo_radio<?php echo $val; ?>' id='rad2<?php echo $val; ?>' value='no'> No</label>
  <div class='label' id='demo_radio_ta_label<?php echo $val; ?>'> <?php if ((strpos($val,'Sparring') || strpos($val,'Feet')) !== false){
    ?>
  <form action="insert.php" method="post" enctype="multipart/form-data" >
  <select name="item1">
    <option value="Child 12/13">Child 12/13</option>
    <option value="1/2">1/2</option>
    <option value="3/4">3/4</option>
    <option value="5/6">5/6</option>
    <option value="7/8">7/8</option>
    <option value="9/10">9/10</option>
    <option value="11/12">11/12</option>
    <option value="13/14">13/14</option>
  </select>
  <input name="submit" type="submit" value="submit" />
  </form>
  <?php } else if ((strpos($val,'Sparring') || strpos($val,'Hands')) !== false){
    ?>
        <form action="" method="post" class="sub">

    <input name="item" type="hidden" value="Sparring Hands...shoe size: " />
please enter shoe size(hands are based on shoe size) <input name="item1" type="text" />
   <input name="submit" type="submit" value="submit" />

</form>
  <?php } else if ((strpos($val,'Sparring') || strpos($val,'Shins')) !== false){
    ?>
        <form action="" method="post" class="sub">
    <input name="item" type="hidden" value="Sparring shins...shoe size:" />
  please enter shoe size(shins are based on shoe size) <input name="item1" type="text" />
    <input name="submit" type="submit" value="submit" />
</form>
  <?php } else if ((strpos($val,'Sparring') || strpos($val,'head')) !== false){
    ?>
        <form action="" method="post" class="sub">
    <input name="item" type="hidden" value="Sparring Head: size" />
    please keep in mind most people are XL
  <select name="item1">
    <option value="Small">Small</option>
    <option value="Medium">Medium/Lg</option>
    <option value="Large">X-Large</option>
  </select>
    <input name="submit" type="submit" value="submit" />
</form>
  <?php } else if ((strpos($val,'Sparring') || strpos($val,'Elbow Pads')) !== false){
    ?>
        <form action="" method="post" class="sub">

    <input name="item" type="hidden" value="elbow pads" />
     <input name="submit" type="submit" value="submit" />
</form>
  <?php } else if ((strpos($val,'Sparring') || strpos($val,'Groin Protector')) !== false){
    ?>
    <form action="" method="post" class="sub">
<input name="item" type="hidden" value="Groin protector size: " />
  <select name="item1">
    <option value='Child Cup Sm (20"-26")'>Child Cup Sm (20"-26")</option>
    <option value='Child Cup Lrg (26"-32")'>Child Cup Lrg (26"-32")</option>
    <option value='Adult Small (26"-32")'>Adult Small (26"-32")</option>
    <option value='Adult Medium (32"-38")'>Adult Medium (32"-38")</option>
    <option value='Adult Large (38"-44")'>Adult Large (38"-44")</option>
    <option value='Adult X-Large (44"-50")'>Adult X-Large (44"-50")</option>
  </select>
   <input name="submit" type="submit" value="submit" />
</form>
  <?php } else if ($val=='Sparring/Ecas Gear:ECAS Gear'){
    ?>
    <form action="" method="post" class="sub"><input name="item" type="hidden" value="Ecas Gear size " />

    Shin/elbow
  <select name="shin/elbow">
    <option value="Small">Small</option>
    <option value="Medium">Medium</option>
    <option value="Large">Large</option>
    <option value="X-Large">X-Large</option>
  </select> Shin/elbow
  <select name="glove">
    <option value="Sm/Med">Sm/Med</option>
    <option value="Lg/Xl">Lg/Xl</option>
  
  </select>
   <input name="submit" type="submit" value="submit" />
</form>
  <?php }
  ?> 
</div></legend></fieldset></form>
<?php }
?>

Link to comment
https://forums.phpfreaks.com/topic/257796-syntax/#findComment-1321329
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.