主题:  如何将部分信息从前台省略

青苹果

职务:普通成员
等级:1
金币:0.0
发贴:59
#12007/1/5 10:55:10
我校有一校长信箱,是用来听取家长的意见,现在的想法是,校长在后台管理回复家长留言时可以看到电话与信箱之类的隐私的内容,而前台就不能够显示电话了,下面是我编写的代码,现在只能实现后台前台一起显示,如何做到前台不显后台显呢,望解答
附代码:

--------------------------------

<html>
    <head>
    <!--head区信息-->
        <title><?=$gbtitle?> - 阅读信件</title>
        <META http-equiv="pragma" content="no-cache">
        <META http-equiv="expires" content="0">
        <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
        <meta http-equiv="Content-Language" content="zh_cn">
        <link href="custom/style.css" rel="stylesheet" type="text/css">
    </head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<!--横幅-->
        <table border="0" cellpadding="0" cellspacing="0" width="775" align="center">
         <tr>
         <td ><img src="custom/top.jpg" width="775" height="117" border="0"></td>
         </tr>
        </table>
<!--开始阅读信件-->
<?php
$gbs = $DB->query("SELECT * FROM ".$db_prefix."webmaildb WHERE gid='".intval($mail_id)."'");
    $webmaildb=$DB->fetch_array($gbs);
    $mailaddtime="&nbsp;收到时间:".FormatDate($webmaildb['addtime'],'%Y-%m-%d %H:%M:%S');
    //检查留言是否回复
    $reply=0;
    if ($webmaildb['replycontent'] != "") {
        $reply=1;
        $replycontent_read="&nbsp;<font color=red>已回复</font>";
        $mailreplytime="&nbsp;回复时间:".FormatDate($webmaildb['replytime'],'%Y-%m-%d %H:%M:%S');
    }else {
        $replycontent_read="&nbsp;未回复";
        $mailreplytime="&nbsp;<a href=\"reply.php?gid=".$webmaildb['gid']."\" ><font color=blue>进行回复</font></a>";
    }
    //修改阅读人数
    $webmaildb['number'] = $webmaildb['number']+1;
    $sql="UPDATE ".$db_prefix."webmaildb SET number='".addslashes($webmaildb['number'])."' WHERE gid='".intval($gid)."'";
    $result = mysql_query($sql);
    

?>
        <table width="775" border="0" cellspacing="0" cellpadding="0" align="center">
            <tr>
                <td bgcolor="#000000">
                    <table width="100%" border="0" cellspacing="1" cellpadding="0">
<tr bgcolor="#FFFFFF">
<td width="28%" height="30" bgcolor="CDDFF7">&nbsp;信件发送者:<?php echo $webmaildb['name'] ;?></td>
<td width="28%" bgcolor="CDDFF7">&nbsp;E-mail:<?php echo $webmaildb['email'] ; ?></td>
<td width="16%" bgcolor="CDDFF7">&nbsp;电话:<?php echo $webmaildb['tel'] ; ?></td>
<td width="11%" bgcolor="CDDFF7"><?php echo $replycontent_read ;?></td>
<td width="17%" bgcolor="CDDFF7"><?php echo $mailreplytime ;?></td>
</tr>
<tr bgcolor="#FFFFFF" height="30">
<td colspan="2" bgcolor="FFFFF0" class="14px" style="padding-left:10px"><strong>信件标题:</strong><?php echo $webmaildb['title'] ;?></td>
<td colspan="3" bgcolor="FFFFF0" class="14px" style="padding-left:10px"><?php echo $mailaddtime; ?></td>
</tr>
<tr bgcolor="#FFFFFF">
<td colspan="5" class="14px" style="padding:10px" bgcolor="FFFFF0" valign="top">
<?php echo html_clean_out($webmaildb['content']); ?> </td>
</tr>
<?php //开始输出回复
                                if($reply){ ?>
<tr bgcolor="#FFFFFF">
<td colspan="4" height="30" class="12px" bgcolor="fffff0" style="padding-left:10px"><font color=red>信件回复内容</font></td>
<td height="30" class="12px" bgcolor="fffff0" ><strong><?php echo $mailreplytime ;?></td>
</tr>
<tr bgcolor="#FFFFFF">
<td colspan="5" bgcolor="fffff0" class="14px" style="padding:20px">
<?php echo html_clean_out($webmaildb['replycontent']); ?> <BR> <p align=center>校长信箱
</td>
</tr>
<?php } ?>
</table>

                </td>
            </tr>
        </table>
    
<!--页底-->
<table width="775" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><div align="center"><br>
<hr align="center" noshade>
<br>
技术支持:<a href="http://www.topnt.cn/" target="_blank">三元路小学</a><br>
</div></td>
</tr>
</table>
</body>
</html>


------------------------------------