0
我geting错误,但代码正在工作! 这是我的代码我的PHP代码与错误工作
<?php
require('connect.php');
$name = $_POST['name'];
$comment = $_POST['comment'];
$submit = $_POST['submit'];
if ($submit) {
if ($name && $comment) {
$insert = mysql_query("INSERT INTO comment (name, comment) VALUES ('$name', '$comment')");
} else {
echo "Please fill all fields";
}
}
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<form action="index.php" method="POST">
<table>
<tr><td>Name: </td><td><input type="text" name="name" /></td></tr>
<tr><td colspan="2">Comment: </td></tr>
<tr><td colspan="2"><textarea name="comment"></textarea></td></tr>
<tr><td colspan="2"><input type="submit" name"submit" value="Comment"/> </td></tr>
</table>
</form>
<?php
$getquery = mysql_query("SELECT * FROM comment ORDER BY id DESC");
while($rows = mysql_fetch_assoc($getquery))
{
$id = $rows['id'];
$name = $rows['name'];
$comment = $rows['comment'];
echo $name . "<br />" . $comment ;
}
?>
</body>
,这是我的错误:用C名称:
注意:未定义指数\ XAMPP \ htdocs中\的index.php上线4
公告:未定义指数:在C注释:\ XAMPP \ htdocs中\的index.php上线5
注意:未定义指数:用C提交:\ XAMPP \ htdocs中\的index.php上线6
但是我说再次,代码工程不管错误!错误坐在那里所有的时间...
什么是诉讼的指向插入,如果所有这些3个变量,其中空? – RiggsFolly
如果他们是空的他们不输入“如果其他” –
谢谢杰弗森萨尔瓦多,没有更多的错误... – Funker