addnote.php
<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<TITLE>添加留言</TITLE>
<style type="text/css">
<!--
.white12 { font-size: 12pt; color: #FFFFFF; text-decoration: none}
-->
</style>
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<table width="98%" border="0" cellspacing="0" cellpadding="0" height="61">
<tr>
<td height="62" width="34%"><a href="http://www.medguider.com"><img src="image/logo.gif" width="243" height="60" alt="医学导航网" border="0"></a></td>
<td height="62" width="66%">
<div align="center"><img src="image/note.gif" width="410" height="60"><img src="image/y1.gif" width="60" height="60"></div>
</td>
</tr>
</table>
<?php
include ("config.php");
if ($submit){
$time=date("Y年m月d日 H:i:s A");
$ip=$REMOTE_ADDR;//留言人ip地址
$name=trim($name);
$email=trim($email);
$title=strip_tags($top);
$nnote=nl2br(strip_tags($content));//先去掉html标记,再将换行符转成 <br>。
if (!$name||!$email||!$title||!$nnote){ //检查是否填写完整
echo "对不起,您必须填所有内容!<BR>"."<a href='javascript:history.back()'>返回</a>";
exit; }elseif(!ereg('^[-!#$%&'*+./0-9=?A-Z^_`a-z{|}~]+'.'@'.'[-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+.'.'[-!#$%&'*+./0-9=?A-Z^_`a-z{|}~]+$',$email) //email合法性验证
){
echo "email不合法!<BR>"."<a href='javascript:history.back()'>返回</a>";
exit;
}
//写入数据库
$sql="INSERT INTO notebook (name,email,time,face,ip,title,nnote) VALUES ('$name','$email','$time','$face','$ip','$title','$nnote')";
$result = mysql_query($sql,$db);
mysql_close($db);
echo "留言成功!";
}
?>
<table width="99%" border="1" cellspacing="0" cellpadding="0" align="center" bordercolor="#3366FF">
<tr bgcolor="#3366FF">
<td width="81%" class="white12" height="26"><a href="../index.php" class="white12">首页</a>
> <a href="index.php" class="white12">留言簿</a>
> 添加留言</td>
<td width="19%" class="white12" height="26"><a href='index.php' class="white12">查看留言</a>
</td>
</tr>
<tr>
<td colspan="2">
<form name="form1" method="post" action="addnote.php">
<table width="99%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="54%"> </td>
<td rowspan="2" width="46%">选择一个自己喜欢的头像:<br>
<img src="image/face/icon1.gif" width="32" height="32">
<input type="radio" name="face" value="1" checked>
<img src="image/face/icon2.gif" width="32" height="32">
<input type="radio" name="face" value="2">
<img src="image/face/icon3.gif" width="32" height="32">
<input type="radio" name="face" value="3">
<img src="image/face/icon4.gif" width="32" height="32">
<input type="radio" name="face" value="4">
<img src="image/face/icon5.gif" width="32" height="32">
<input type="radio" name="face" value="5">
<img src="image/face/icon6.gif" width="32" height="32">
<input type="radio" name="face" value="6">
<img src="image/face/icon7.gif" width="32" height="32">
<input type="radio" name="face" value="7">
<img src="image/face/icon8.gif" width="32" height="32">
<input type="radio" name="face" value="8">
<img src="image/face/icon9.gif" width="32" height="32">
<input type="radio" name="face" value="9">
<img src="image/face/icon10.gif" width="32" height="32">
<input type="radio" name="face" value="10">
<img src="image/face/icon11.gif" width="32" height="32">
<input type="radio" name="face" value="11">
<img src="image/face/icon12.gif" width="32" height="32">
<input type="radio" name="face" value="12">
<img src="image/face/icon13.gif" width="32" height="32">
<input type="radio" name="face" value="13">
<img src="image/face/icon14.gif" width="32" height="32">
<input type="radio" name="face" value="14">
<img src="image/face/icon15.gif" width="32" height="32">
<input type="radio" name="face" value="15">
<img src="image/face/icon16.gif" width="32" height="32">
&nb
[1] [2] [3] [4] 下一页