There are quite a few posts on Google regarding this subject, but it’s comparable to reading Japanese :-p I just need a straight forward explanation on how to store my radio button option to mysql database and have that selection stay selected when the user logs back in.
Below is the radio button excerpt from my form:
<td width=”24″><span class=”med”>
<input type=”radio” name=”quotationinsurance” value=”<?php
if($form->value(“quotation”) == “”){
echo $session->userinfo[‘quotation’];
}else{
echo $form->value(“quotation”);
}
?>” class=”btn” onMouseOver=”hov(this,’btn btnhov’)” onMouseOut=”hov(this,’btn’)” />
</span></td>
<td width=”54″><span class=”small”>Insurance</span></td>
<td width=”271″><span class=”med”>
<input type=”radio” name=”quotationinsurance” value=”<?php
if($form->value(“insurance”) == “”){
echo $session->userinfo[‘insurance’];
}else{
echo $form->value(“insurance”);
}
?>” class=”btn” onMouseOver=”hov(this,’btn btnhov’)” onMouseOut=”hov(this,’btn’)” />
</span></td>
Below is the php:
function procEditFormOne(){
global $session, $form;
/* form one edit attempt
$retval = $session->editFormOne($_POST[‘quotationinsurance’], $_POST[‘individuals’], $_POST[‘parnternship’], $_POST[‘requestedfrom’], $
/* Form one edit successful */
if($retval){
$_SESSION[‘subFormOneEdit’] = true;
header(“Location: “.$session->referrer);
}
/* Error found with form */
else{
$_SESSION[‘value_array’] = $_POST;
$_SESSION[‘error_array’] = $form->getErrorArray();
header(“Location: “.$session->referrer);
}
}
Below is the column structure ‘quotationinsurance’ for the database table named user:
Column: quotationinsurance
Type: SET
Length/Values: ‘quotation’,’insurance’
Default: None
Every time I make a selection and click the save/submit button, the selection disappears. I’m not sure what I’m really doing wrong; Just need a straight forward; preferably slow explanation 🙂