我有以下 php 代码。如何修改复选框以在我的数据库中保留作为“勾号”的选定值,然后再次打印回来?
<?php
if ( isset($_GET['success']) === true && empty($_GET['success'])===true ){
echo'Updated Sucessfuly!';?>
<?php
}else{
if( empty($_POST) === false && empty($errors) === true ){
$update_data_profile_career = array(
'Consulting' => $_POST['Consulting'],
'user_id' => $session_user_id,
);
update_user_profile_career($session_user_id, $update_data_profile_career);
header('Location: profile_update_career_goal.php?success');
exit();
}else if ( empty($errors) === false ){
echo output_errors($errors);
echo'</br></br>';
}
?>
<input type="checkbox" name="Consulting[]" value="<?php echo $user_data_profile_career['Consulting']; ?>" />Consulting