技能是表单中的选项标记,但未选中的选项在进程页面中提交后显示未定义的索引。这是我在流程页面中使用的代码:
if (isset($_POST['submit_form'])) {
$name = strip_tags($_POST['name']);
$email = strip_tags($_POST['email']);
$subject = htmlspecialchars($_POST['subject']);
$gender = strip_tags($_POST['gender']);
$country = strip_tags($_POST['country']);
$comment = trim(htmlspecialchars($_POST['comment']));
$skills1 = $_POST['skills1'];
$skills2 = $_POST['skills2'];
$skills3 = $_POST['skills3'];
$skills4 = $_POST['skills4'];
$skills5 = $_POST['skills5'];
$ins_sql = "INSERT INTO comments (name, email, subject, gender, skills1, skills2, skills3, skills4, skills5, country, comment) VALUES ('$name', '$email', '$subject', '$gender', '$skills1', '$skills2', '$skills3', '$skills4', '$skills5', '$country', '$comment')";
$run_sql = mysqli_query($conn, $ins_sql);
} else {
}