<?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();
}
}
?>
$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();
}
}
?>
Notice: Undefined variable: submit in D:\phpnow\htdocs\web\title.php on line 5
error_reporting(E_ALL ^ E_NOTICE);
试试看
就可以用了。