So I have a page where users can edit their profile. There users first get data fetched from my database so for example one of the checkboxes is checked. Then I want the users to be able to update their checkboxes but for some reason the "post" method doesn't pass the right data. My view:
<form method="post" action="<?php echo $this->config->base_url(); ?>index.php/profile/update/<?php echo $user['patient_id']; ?>">
<div>
<?php
if($user['sport_ban']){
$checked = "checked";
}else{
$checked = "";
}
echo "Sport ban: "."<input type='checkbox' name='sport_ban'
value='".$user['sport_ban']."'".$checked.">";
?>
</div>
<input type="submit" value="Aanpassingen opslaan" name="submit">
</form>
my controller:
$gele_kaart = $this->input->post('gele_kaart');
$sport_ban = $this->input->post('sport_ban');