您现在的位置: 军旅同心-旅游自驾-军旅文学 >> 读书赏析 >> 学习园地 >> 电脑网络 >> 技术文章 >> 正文
PHP新手上路(十一)
作者:采集员 文章来源:来源于网络 点击数: 更新时间:2005-9-10 14:34:44
: 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></CENTER>";
}
?>
<BR><SMALL><CENTER>版权所有:<A HREF="http://personal.668.cc/haitang/index.htm" onMouseOver="window.status='pert';return true" onMouseOut="window.status=';return true" TITLE="pert">无边天际</A></CENTER></SMALL>
</FONT>
</BODY>
</HTML>  

上一页  [1] [2] 


更多
免责声明:作品版权归所属媒体与作者所有!!本站刊载此文不代表同意其说法或描述,仅为提供更多信息。如果您认为我们侵犯了您的版权,请告知!本站立即删除。有异议请联系我们。
文章录入:烟灰缸    责任编辑:烟灰缸 
  • 上一篇文章:
  • 下一篇文章:
  • 网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)
    | 设为首页 | 加入收藏 | 联系站长 | 友情链接 | 网站地图 | 版权申明 | 网站公告 | 管理登录 |