上两节我针对guest.php和edit.php作了讲述.需要注意的是php和html的区别:
php通常是–>(1)<? echo(“zihanonline”);?>
(2)<? php
echo(“zihanonline”);
?>
(3)<script laanguage=”php”>
echo(“zihanonline”);
</script>
(4)<% echo(“zihanonline”);%>
等4种方式.不要混淆.
下面我们来研究信息管理:manage.php代码.
———–
//manage.php<html>
<head>
<title>留言管理</title>
<meta http-equiv=”content-type” content=”text/html; chart=gb2312″>
<style>
<!–
a:link {text-decoration: none ; color:0000ff}
a:visited {text-decoration: none; color:004080}
a:active {text-decoration: none}
a:hover {text-decoration: underline; color:ff0000}
body {font-size: 9p}
th {font-size: 9pt}
td {font-size: 9pt}
–>
</style>
</head>
<body bgcolor=”#ffffff” background=”back.gif”>
<?
include(‘head.htm’);
include(“sys.php”);
if ($password!=$managepwd and $dispflag)
{
echo “<meta http-equiv=refresh content=5;url=guest.php>”;
echo “<center>”;
echo “<font color=red>密码错误!无法删除留言!</font>”;
echo “<p>程序将在3秒返回</p>”;
echo “<p> <a href=http://zihanonline.longcity.net>子汉在线</a>斑竹维护管理。</p>”;
echo “<br>”;
echo “</center>”;
exit;
}
?>
<table width=”445″ border=”0″ align=”center” bgcolor=”#cccccc”>
<form method=”post” action=”manage.php”>
<?
if ($dispflag==”show”WILL什么意思;)
{
$content = file($guestfile);
$count =count($content);
$text=””;
for ($h=$count;$h>0;$h–)
{
$text=$text.'<tr><td>删除第’.$h.”条留言:<input type=checkbox name=check$h value=$h></td></tr>nn”;
$text=$text.$content[$h体育格言-1];
}
you的复数形式echo “$text”;
}
?>
<input type=hidden name=password value=<? echo $password ?>>
<?
if ($submit)
{
if ($password!=$managepwd)
{
echo “<meta http-equiv=refresh content=5;url=guest.php>”;
echo “<center徐良的歌词>”;
echo “<font color=red>密码错误!无法删除留言!</font>”;
echo “<p>程序将在3秒返回</p>”;
echo “<p> <a href=http://zihanonline.longcity.net>子汉在线</a>斑竹维护管理。</p>”;
echo “<br>”;
echo “</center>”;
exit;
}
if ($password==$managepwd)
{
$guest_content=file($guestfile);
$count=count($guest_content);
for ($j=1;$j<=$count;$j++)
{
$del_rec_num=”check”.$j;
$del_num=$$del_rec_num;
//echo “$del_num:$del_num”;
$guest_content[$del_num-1]=””;
}
$fp=fopen($guestfile,”w”);
for ($i=0;$i<=$count-1;$i++)
{
if ($guest_content[$i]!=””)
{
fputs($fp,$guest_content[$i],strlen($guest_content[$i]));
}
}
fclo($fp);
echo 拜新年 凤凰传奇8220;<meta http-equiv=refresh content=5;url=guest.php>”;
echo “<center>”;
echo “<p><font color=red>留言已正确删除</font></p>”;
echo “<p>程序将在3秒返回</p>”;
echo “<p> <a href=http://zihanonline.longcity.net>子汉在线</a>斑竹维护管理。</p>”;
echo “<br>”;
echo “</center>”;
exit;
}
}
?>
<tr>
<td bgcolor=”#f0f0f0″>
<p align=center>
<input type=submit value=删除 name=submit>
<input type=ret value=重写 name=ret>
</td>
<tr>
</form>
</table>
<?include(‘bottom.htm’);?>
</body>
</html>
————
未完待续…
本文发布于:2023-04-06 05:32:11,感谢您对本站的认可!
本文链接:https://www.wtabcd.cn/fanwen/zuowen/22d9abea6cd09f787e56e7bbfac63a22.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文word下载地址:一个php作的文本留言本的例子(三).doc
本文 PDF 下载地址:一个php作的文本留言本的例子(三).pdf
留言与评论(共有 0 条评论) |