TD ALIGN="LEFT"> </TD><TD ALIGN="LEFT" NOWRAP> </TD></TR><TR><TD ALIGN="LEFT">$comments</TD><TD ALIGN="LEFT" NOWRAP> </TD></TR><TR><TD ALIGN="LEFT"> </TD><TD ALIGN="LEFT" NOWRAP> </TD></TR><TR><TD ALIGN="LEFT">您的留言:</TD><TD ALIGN="LEFT" NOWRAP>$name</TD></TR><TR><TD ALIGN="LEFT">您的大名:</TD><TD ALIGN="LEFT" NOWRAP>$email</TD></TR><TR><TD ALIGN="LEFT">您的email:</TD><TD ALIGN="LEFT" NOWRAP>$job</TD></TR><TR><TD ALIGN="LEFT">您的工作:</TD></TR></TABLE></BODY></FONT></HTML>", "From: $name <$email>nReply-To: $name <$email>nContent-type: text/htmlnX-Mailer: PHP/" . phpversion());
}
/* MySQL really hates it when you try to put things with '' or " characters into a database, so strip these...*/
$comments = addslashes ("$comments");
$query = "INSERT INTO guestbook VALUES('''',''$name'', ''$email'', ''$job'', ''$comments'')";
$result = MYSQL_QUERY($query);
?>
<BR><P ALIGN = CENTER>感谢, <?php echo $name; ?>, 您的留言.
<BR><P ALIGN = CENTER><A HREF="guestbook.php3?action=view" onMouseOver="window.status=''View your comment now'';return true" onMouseOut="window.status='''';return true" TITLE="View your comment now">观看留言</A><BR><BR>
<?
}
/* if there''s no action given, then we must show the main page */
else {
/* get the number of entries written into the guestbook*/
$query = "SELECT name from guestbook";
$result = MYSQL_QUERY($query);
$number = MYSQL_NUMROWS($result);
if ($number == "") {
$entry = "还没有人留过言"; }
elseif ($number == "1") {
$entry = "目前留言人数1人"; }
else {
$entry = "目前留言人数 $number 人"; }
echo "<CENTER><BR>";
echo "<P>$entry<BR>";
echo "<H4><FONT FACE="Verdana" SIZE="3"><A HREF="guestbook.php3?action=add" onMouseOver="window.status=''请您留言'';return true" onMouseOut="window.status='''';return true" TITLE="Add your name to our guestbook">请您留言</A></FONT></H4>";
if ($number > "") {
echo "<H4><FONT FACE="Verdana" SIZE="3"><A HREF="guestbook.php3?action=view" onMouseOver="window.status=''观看留言'';return true" onMouseOut="window.status='''';return true" TITLE="View the names in our guestbook">观看留言</A></FONT></H4>"; }
echo "</P>& |