$_POST[]问题
看PHP100的视频教程中的留言板部分,里面有句是这么写的:
<!--
Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/
-->
if($_POST['submit'])
{
$sql = "insert into msg (id, userid, contant, oppeardata) values ('', '999', '$_POST[contant]', Now())";
print $sql;
$sql_return = mysql_query($sql);
if(!$sql_return)
{
print("发表留言错误").mysql_error();
exit();
}
print("发表留言成功</br>");
if (isset($_POST['submit'])) <br><font color="#e78608">------解决方案--------------------</font><br>第一个notice是因为你调用了不存在的变量($_POST['submit'])<br><br>第二个$_POST[submit]是因为你submit两边没有引号引起来,应该$_POST['submit']或者$_POST["submit"] <div class="clear"></div>
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号