<?php
  $mysql_db=mysql_connect("localhost","root","372110");
  mysql_select_db("test",$mysql_db);
  if($submit)
  {
     if(!empty($name) && !empty($title) &&! empty($coment))
{
   $time=date("y-m-d H:i:s");
   $ip=$REMOTE_ADDR;
   $sql="INSERT into guestbook(name,email,homepage,dity,country,title,comment,time,ip)
        VALUES('$name','$email','$homepage','$dity','$country','$title','$coment','$time','$ip')";
   $sql_result=mysql_query($sql);
    }
else
{
  print("<center>请您将带*的内容填齐。<br>");
  print("<a href=\"guest.php3\">返回重填</a></center>");
  exit();
 }
}
?>

解决方案 »

  1.   

    求高手帮忙
    Notice: Undefined variable: submit in D:\phpnow\htdocs\web\title.php on line 5
      

  2.   

    和php.ini里的配置有关,程序开头加个
    error_reporting(E_ALL ^ E_NOTICE);
    试试看
      

  3.   

    程序已经解决,谢谢高手的帮忙,是配置出现了问题,在开头加了error_reporting(E_ALL ^ E_NOTICE);
    就可以用了。