无为清净楼资源网 Design By www.qnjia.com
guestbook.php:
<head>
<meta http-equiv="Content-Language" c>
<meta http-equiv="Content-Type" c>
<title></title>
<STYLE>A:link {
COLOR: #002878; TEXT-DECORATION: none
}
A:visited {
COLOR: #002878; TEXT-DECORATION: none
}
A:active {
TEXT-DECORATION: none
}
A:hover {
COLOR: #cc1111; TEXT-DECORATION: none
}
P {
COLOR: #002878; FONT-SIZE: 9pt
}
TABLE {
COLOR: #002878; FONT-SIZE: 9pt
}
LI {
COLOR: #002878; FONT-SIZE: 9pt; LINE-HEIGHT: 14pt
}
UL {
COLOR: #002878; FONT-SIZE: 9pt
}
}
</STYLE>
</head>
<body>
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" width="574" height="312">
</center>
<tr>
<td><p align="center">高三<6>班留言本本</br></td>
</tr>
<tr>
<td width="574" height="272" valign="top">
<form method="POST" action="ly.php">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<center>
<tr>
<td width="26%" align="right">
姓名:</td>
<td width="74%"><input style="font-size: 9pt; width: 186; background-color: #f8f8f8; height: 19; border: 1px solid #9a9999"
type="text" name="T1" size="13"></td>
</tr>
<tr>
<td width="26%" align="right">
EMAIL:</td>
<td width="74%"><input style="font-size: 9pt; width: 186; background-color: #f8f8f8; height: 19; border: 1px solid #9a9999" name="T2" size="13"></td>
</tr>
<tr>
<td width="26%" align="right">
个人主页:</td>
<td width="74%"><input style="font-size: 9pt; width: 186; background-color: #f8f8f8; height: 19; border: 1px solid #9a9999" name="T3" size="13" value="http://";></td>
</tr>
<tr>
<td width="26%" align="right">
主题:</td>
<td width="74%"><input style="font-size: 9pt; width: 186; background-color: #f8f8f8; height: 19; border: 1px solid #9a9999" name="T4" size="13"></td>
</tr>
<tr>
<td width="26%" align="right" valign="top">
留言:</td>
<td width="74%"><textarea style="font-size: 9pt; width: 313; background-color: #f8f8f8; height: 177; border: 1px solid #9a9999" rows="10" name="S1" cols="45" ></textarea></td>
</tr>
<tr>
<td width="100%" align="right" colspan="2">
</td>
</tr>
</table>
<p align="center">
<input type="submit" value="提交" name="B1"> <input type="reset" value="重写" name="B2"></p>
</form>
</center>
</td>
</tr>
</table>
<hr size='1' color='#6666FF'>
</div>
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" width="603" height="294">
<tr>
<td width="603" height="294">
<?
include ("connect.rec");
$qh=mysql_query("SELECT COUNT(*) AS rcnt FROM guestbook");
$data=mysql_fetch_array($qh);
$nr=$data["rcnt"];
//判断偏移量参数是否传递给了脚本,如果没有就使用默认值0
if (empty($offset))
{
$offset=0;
}
//查询结果(这里是每页20条,但你自己完全可以改变它)
//$result=mysql_query("SELECT * from guestbook ORDER BY time desc LIMIT $offset, 5");
$result=mysql_query("SELECT * from guestbook LIMIT $offset, 5");
//显示返回的5条记录
while ($data=mysql_fetch_array($result))
{
printf("姓名:<font color='#000000'>%s</font><br>",$data["name"]);
printf("EMAIL:<font color='#3366FF'>%s</font><br>",$data["mail"]);
printf("个人主页:<font color='#3366FF'>%s</font><br>",$data["url"]);
printf("来自:<font color='#3366FF'>%s</font><br>",$data["ip"]);
printf("留言时间:<font color='#3366FF'>%s</font><br>",$data["time"]);
printf("主题:<font color='#3366FF'>%s</font><br>",$data["title"]);
printf("内容:<font color='#000000'>%s</font><br>",$data["ly"]);
printf("<hr size='1' color='#6666FF'>");
}
//下一步,要写出到其它页面的链接
if($offset) //如果偏移量是0,不显示前一页的链接
{
$preoffset=$offset-5;
print "<a href="$PHP_SELF?offset=$preoffset">前一页</a> n";
}
//计算总共需要的页数
$pages=ceil($nr/5); //$pages变量现在包含所需的页数
for ($i=1; $i <= $pages; $i++)
{
$newoffset=5*$i-5;
print "<a href="$PHP_SELF?offset=$newoffset">$i</a> n";
}
//检查是否是最后一页
$next = $offset+5;
if ($next<$nr)
{
print "<a href="$PHP_SELF?offset=$next">下一页</a> n";
}
printf("<a href='javascript:history.back()'>返回</a>")
?>
</td>
</tr>
</table>
</center>
</div>
</body>
</html>
ly.php:
<?
include ("connect.rec");
$name = $T1;
$mail = $T2;
$url = $T3;
$title = $T4;
$time = date( "Y-m-j H:i:s" );
$ip = getenv("REMOTE_ADDR");
$ly = $S1;
$result = mysql_query("insert into guestbook (name,mail,url,ip,time,title,ly) values ('$name','$mail','$url','$ip','$time','$title','$ly')");
if ($result == 1)
{
echo("留言成功!");
printf("<script language='javascript'>");
printf("location='guestbook.php'");
printf("</script>");
}
else
{
echo("留言失败!");
printf("<a href='javascript:history.back()'>返回</a>");
}
?>
<head>
<meta http-equiv="Content-Language" c>
<meta http-equiv="Content-Type" c>
<title></title>
<STYLE>A:link {
COLOR: #002878; TEXT-DECORATION: none
}
A:visited {
COLOR: #002878; TEXT-DECORATION: none
}
A:active {
TEXT-DECORATION: none
}
A:hover {
COLOR: #cc1111; TEXT-DECORATION: none
}
P {
COLOR: #002878; FONT-SIZE: 9pt
}
TABLE {
COLOR: #002878; FONT-SIZE: 9pt
}
LI {
COLOR: #002878; FONT-SIZE: 9pt; LINE-HEIGHT: 14pt
}
UL {
COLOR: #002878; FONT-SIZE: 9pt
}
}
</STYLE>
</head>
<body>
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" width="574" height="312">
</center>
<tr>
<td><p align="center">高三<6>班留言本本</br></td>
</tr>
<tr>
<td width="574" height="272" valign="top">
<form method="POST" action="ly.php">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<center>
<tr>
<td width="26%" align="right">
姓名:</td>
<td width="74%"><input style="font-size: 9pt; width: 186; background-color: #f8f8f8; height: 19; border: 1px solid #9a9999"
type="text" name="T1" size="13"></td>
</tr>
<tr>
<td width="26%" align="right">
EMAIL:</td>
<td width="74%"><input style="font-size: 9pt; width: 186; background-color: #f8f8f8; height: 19; border: 1px solid #9a9999" name="T2" size="13"></td>
</tr>
<tr>
<td width="26%" align="right">
个人主页:</td>
<td width="74%"><input style="font-size: 9pt; width: 186; background-color: #f8f8f8; height: 19; border: 1px solid #9a9999" name="T3" size="13" value="http://";></td>
</tr>
<tr>
<td width="26%" align="right">
主题:</td>
<td width="74%"><input style="font-size: 9pt; width: 186; background-color: #f8f8f8; height: 19; border: 1px solid #9a9999" name="T4" size="13"></td>
</tr>
<tr>
<td width="26%" align="right" valign="top">
留言:</td>
<td width="74%"><textarea style="font-size: 9pt; width: 313; background-color: #f8f8f8; height: 177; border: 1px solid #9a9999" rows="10" name="S1" cols="45" ></textarea></td>
</tr>
<tr>
<td width="100%" align="right" colspan="2">
</td>
</tr>
</table>
<p align="center">
<input type="submit" value="提交" name="B1"> <input type="reset" value="重写" name="B2"></p>
</form>
</center>
</td>
</tr>
</table>
<hr size='1' color='#6666FF'>
</div>
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" width="603" height="294">
<tr>
<td width="603" height="294">
<?
include ("connect.rec");
$qh=mysql_query("SELECT COUNT(*) AS rcnt FROM guestbook");
$data=mysql_fetch_array($qh);
$nr=$data["rcnt"];
//判断偏移量参数是否传递给了脚本,如果没有就使用默认值0
if (empty($offset))
{
$offset=0;
}
//查询结果(这里是每页20条,但你自己完全可以改变它)
//$result=mysql_query("SELECT * from guestbook ORDER BY time desc LIMIT $offset, 5");
$result=mysql_query("SELECT * from guestbook LIMIT $offset, 5");
//显示返回的5条记录
while ($data=mysql_fetch_array($result))
{
printf("姓名:<font color='#000000'>%s</font><br>",$data["name"]);
printf("EMAIL:<font color='#3366FF'>%s</font><br>",$data["mail"]);
printf("个人主页:<font color='#3366FF'>%s</font><br>",$data["url"]);
printf("来自:<font color='#3366FF'>%s</font><br>",$data["ip"]);
printf("留言时间:<font color='#3366FF'>%s</font><br>",$data["time"]);
printf("主题:<font color='#3366FF'>%s</font><br>",$data["title"]);
printf("内容:<font color='#000000'>%s</font><br>",$data["ly"]);
printf("<hr size='1' color='#6666FF'>");
}
//下一步,要写出到其它页面的链接
if($offset) //如果偏移量是0,不显示前一页的链接
{
$preoffset=$offset-5;
print "<a href="$PHP_SELF?offset=$preoffset">前一页</a> n";
}
//计算总共需要的页数
$pages=ceil($nr/5); //$pages变量现在包含所需的页数
for ($i=1; $i <= $pages; $i++)
{
$newoffset=5*$i-5;
print "<a href="$PHP_SELF?offset=$newoffset">$i</a> n";
}
//检查是否是最后一页
$next = $offset+5;
if ($next<$nr)
{
print "<a href="$PHP_SELF?offset=$next">下一页</a> n";
}
printf("<a href='javascript:history.back()'>返回</a>")
?>
</td>
</tr>
</table>
</center>
</div>
</body>
</html>
ly.php:
<?
include ("connect.rec");
$name = $T1;
$mail = $T2;
$url = $T3;
$title = $T4;
$time = date( "Y-m-j H:i:s" );
$ip = getenv("REMOTE_ADDR");
$ly = $S1;
$result = mysql_query("insert into guestbook (name,mail,url,ip,time,title,ly) values ('$name','$mail','$url','$ip','$time','$title','$ly')");
if ($result == 1)
{
echo("留言成功!");
printf("<script language='javascript'>");
printf("location='guestbook.php'");
printf("</script>");
}
else
{
echo("留言失败!");
printf("<a href='javascript:history.back()'>返回</a>");
}
?>
标签:
php,mysql,留言本
无为清净楼资源网 Design By www.qnjia.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
无为清净楼资源网 Design By www.qnjia.com
暂无评论...
更新日志
2024年11月15日
2024年11月15日
- 邓丽君.1983-淡淡幽情(2022环球MQA-UHQCD限量版)【环球】【WAV+CUE】
- 试音天碟《专业测试第一天碟》经典天碟精选[WAV分轨][1G]
- 试音典范 《情惹发烧情HQCD》人声发烧极品 [WAV+CUE][1G]
- 世界顶级汽车音响试音王《幸福在路上》[低速原抓WAV+CUE][1.1G]
- 老头杯第二届什么时候开始 英雄联盟第二届老头杯开赛时间介绍
- 老头杯第二届什么时候结束 英雄联盟第二届老头杯结束时间介绍
- 老头杯第二届规则是什么 英雄联盟老头杯第二届规则介绍
- 王崴-爵士听堂.蓝色波萨(HQCD)[WAV+CUE]
- 群星《欧美动听情歌·柔情第5季》2CD【DTS-WAV分轨】
- [极品珍藏]德意志进行曲集卡拉扬SACD[WAV+CUE]
- 前暴雪制作人呼吁反击DEI 玩家:夺回文化!
- 腾讯证实子公司Sharkmob大规模裁员:整个市场很低迷
- 荣耀加冕 问鼎冠军 中国代表队获第四届东亚电竞锦标赛团体总冠军
- 污甩乐队.2024-Let.the.dirt.left【摩登天空】【FLAC分轨】
- 杜德伟.1994-ALL.FOR.YOU(英)【滚石】【WAV+CUE】