我有两个php问件
其中
add.php:
姓名 | |
性别 | 男 女 |
年龄 | |
班级 | |
action.php:
switch($_GET['action']){
case "add":
$name = $_POST['name'];
$sex = $_POST['sex'];
$arge = $_POST['arge'];
$classId = $_POST['classId'];
$sql = "insert into students VALUES (NULL ,'{$name}','{$sex}','{$arge}','{$classId}')";
$rw = $pdo->exec($sql);
if($rw>0){
echo "";
}else{
echo "";
}
break;
}
提交数据时为什么会报如下错误:
Notice: Undefined index: name in /Applications/XAMPP/xamppfiles/htdocs/studentsManager/action.php on line 16
Notice: Undefined index: sex in /Applications/XAMPP/xamppfiles/htdocs/studentsManager/action.php on line 17
Notice: Undefined index: arge in /Applications/XAMPP/xamppfiles/htdocs/studentsManager/action.php on line 18
Notice: Undefined index: classId in /Applications/XAMPP/xamppfiles/htdocs/studentsManager/action.php on line 19
name sex arge classId 不是都有么 为何还时 未定义??