06-05-2010, 08:56 AM
[eluser]RobertB.[/eluser]
Hello guys,
I can't figure out how to do this if is not hard code.
Hard Code to send what the user selected by email.
This work good.
View
Controller
But if I try to do this
Dynamic
I cant figure out the controller side of it. If I print the $_POST i get what the user selected.
Do I have to do another foreach in the controller?
Thanks
Hello guys,
I can't figure out how to do this if is not hard code.
Hard Code to send what the user selected by email.
This work good.
View
Code:
<input type="checkbox" name="ase" value="1" /> ASE
<input type="checkbox" name="atra" value="1" /> ATRA
<input type="checkbox" name="asa" value="1" /> ASA
<input type="checkbox" name="cert_other" value="1" /> Other
Code:
$ase = $this->input->post('ase');
$atra = $this->input->post('atra');
$asa = $this->input->post('asa');
$cert_other = $this->input->post('cert_other');
But if I try to do this
Dynamic
Code:
<?php foreach($certifications as $row => $cert):?>
<input type="checkbox" name="<?=$cert->certification?>" value="<?=$cert->id?>" /> <?=$cert->certification?>
<?php endforeach; ?>
Code:
[ASE] => 1 [ATRA] => 2
Do I have to do another foreach in the controller?
Thanks