Ok!私はPHPの専門家ではありません。ラジオボタンのデータをデータベースの「性別」列に挿入することはできません。phpからdatabseにラジオボタンのデータを挿入できません
Register.php
<label for='gender' >Gender*: </label><br/>
<input type="radio" name="genderf" id="genderf" value='<?php echo $fgmembersite->SafeDisplay('gender') ?>'maxlength="50"/> Female
<input type="radio" name="genderm" id="genderm" value='<?php echo $fgmembersite->SafeDisplay('gender') ?>'maxlength="50"/>Male
とfgmembersite.phpだけデータベース
function CollectRegistrationSubmission(&$formvars)
{
$formvars['name'] = $this->Sanitize($_POST['name']);
$formvars['gname'] = $this->Sanitize($_POST['gname']);
$formvars['age'] = $this->Sanitize($_POST['age']);
$formvars['gender'] = $this->Sanitize($_POST['genderm']);
$formvars['gender'] = $this->Sanitize($_POST['genderf']);
$formvars['school_college'] = $this->Sanitize($_POST['school_college']);
$formvars['class_section'] = $this->Sanitize($_POST['class_section']);
$formvars['stream'] = $this->Sanitize($_POST['stream']);
$formvars['phone_number'] = $this->Sanitize($_POST['phone_number']);
$formvars['username'] = $this->Sanitize($_POST['username']);
$formvars['email'] = $this->Sanitize($_POST['email']);
$formvars['password'] = $this->Sanitize($_POST['password']);
}
$insert_query = 'insert into '.$this->tablename.'(
name,
gname,
age,
gender,
school_college,
class_section,
stream,
phone_number,
email,
username,
password,
salt,
confirmcode
)
values
(
"' . $this->SanitizeForSQL($formvars['name']) . '",
"' . $this->SanitizeForSQL($formvars['gname']) . '",
"' . $this->SanitizeForSQL($formvars['age']) . '",
"' . $this->SanitizeForSQL($formvars['gender']) . '",
"' . $this->SanitizeForSQL($formvars['school_college']) . '",
"' . $this->SanitizeForSQL($formvars['class_section']) . '",
"' . $this->SanitizeForSQL($formvars['stream']) . '",
"' . $this->SanitizeForSQL($formvars['phone_number']) . '",
"' . $this->SanitizeForSQL($formvars['email']) . '",
"' . $this->SanitizeForSQL($formvars['username']) . '",
"' . $encrypted_password . '",
"' . $salt . '",
"' . $confirmcode . '"
)';
There are no errors or exceptions , just the gender column is empty in spite of checking the radio button.