这是员工的注册表单。如果员工是临时员工或永久员工,则必须签入单选按钮。如果是临时的,他应该填写输入的合同编号,如果是永久的,则应填写雇用日期。如何将单选按钮与输入绑定,以便他不能“交叉完成”,例如,如果他是临时的,请填写招聘日期。我想让他只有在按下特定的单选按钮时才能填写每个输入。代码:<?php include 'dbconfig.php';?><?php header('Content-Type: text/html; charset=utf-8');?><!DOCTYPE HTML PUCLIC "-//W3C//DTDHTML4.0 Transitional//EN"><HTML> <HEAD> <link rel="stylesheet" type="text/css" href="logintest.css"> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> </HEAD> <button class="btn" TYPE="submit" name="goback" onclick="window.location.href='login.php'">Go Back </button> <?php error_reporting(E_ALL); ini_set('display_errors', 1); if(isset($_POST['submit'])) { $sql = "INSERT INTO employee (empID,EFirst,ELast,username, passcode) VALUES ('".$_POST["empID"]."','".$_POST["EFirst"]."','".$_POST["ELast"]."','".$_POST["username"]."','".$_POST["passcode"]."')"; $result = mysqli_query($conn,$sql); $answer=$_POST['kind']; if($answer='permament'){ $sql1 = "INSERT INTO permament_employee (empID,Hiring_Date) VALUES ('".$_POST["empID"]."','".$_POST["date"]."')"; $result1 = mysqli_query($conn,$sql1); } if ($answer='temporary'){ $sql2= "INSERT INTO temporary_employee(empID) VALUES ('".$_POST["empID"]."')"; $result2 = mysqli_query($conn,$sql2); } echo "<script> location.replace('login.php') </script>"; }
- 2 回答
- 0 关注
- 155 浏览
添加回答
举报
0/150
提交
取消