0

I have this on top of my Html code

$basisPrijs= array
    (
    array('titel' => 'Kopie', 'uur' => '8'), 
    array('titel' => 'Maatwerk', 'uur' => '10'),
    array('titel' => 'Aangekocht', 'uur' => '12'),
    array('titel' => 'Custom', 'uur' => '14')
    );
if(isset($_POST['emailVerzenden']))
:
$template = $_POST['templates'];
echo $template;
endif; 

and this is my html form

<form action="" method="post">
 <div class="marginTop col-xs-12">
  <label><?php echo $class->template;?></label>
 </div>
 <div class="col-xs-12 col-sm-10 col-md-8 col-lg-6">
  <select id="templates" 
   class="form-control" 
   name="templates">
   <?php foreach($basisPrijs as $key => $value):?>
   <option value="<?php echo $basisPrijs[$key]["uur"];?>">
    <?php echo $basisPrijs[$key]["titel"];?>
   </option><?php endforeach;?>
  </select>
 </div> 
</form>

This is where i got the button

<form action="" method="post">
                        <div class="marginTop form-group col-xs-12 col-sm-10 col-md-8 col-lg-6">
                            <input class="form-control" 
                                   type="email" 
                                   id="email"
                                   name="email" 
                                   placeholder="example@email.com">
                        </div> 
                        <div class="col-xs-12">
                            <button class="btn btn-default"
                                    type="submit"
                                    id="emailVerzenden"
                                    name="emailVerzenden"><?php echo $class->verzenden ?>
                            </button>
                        </div>
                    </form> 

I keep getting Notice: Undefined index: templates, Can someone explain me what i am doing wrong.

Ronald Dewindt
  • 65
  • 1
  • 11

1 Answers1

0

Fixed it , I had them in two different form, i had to use only one big form to process all the info.

Ronald Dewindt
  • 65
  • 1
  • 11