为什么会出现Notice: Undefined index: submit in D:\xampp\htdocs\test.php on line 19

来源:互联网 发布:淘宝网发货地址怎么改 编辑:程序博客网 时间:2024/05/17 04:44

事例如下“:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>

<body>
<?php
    include("lianjie.php");
    if($_POST["submit"]){
        $sql="insert into one (id,fenshu,kemu,pingyu)" . "values ('$_POST[id]','$_POST[fenshu]','$_POST[kemu]','$_POST[pingyu]')";
        mysql_query($sql);
    }
?>
<form method="post" action="liuyan.php">
    学号:<input type="test" name="id"><br />
    分数:<input type="test" name="fenshu"><br />
    科目:<input type="test" name="kemu"><br />
    评语:<textarea name="pingyu"></textarea><br />
    <input type="submit" name="submit" value="提交">
</form>
</body>
</html>

当出现这个notice后,当加上下面这个画红框框的条目后,就可以解决这个问题

0 0
原创粉丝点击