六月婷婷综合激情-六月婷婷综合-六月婷婷在线观看-六月婷婷在线-亚洲黄色在线网站-亚洲黄色在线观看网站

明輝手游網(wǎng)中心:是一個免費提供流行視頻軟件教程、在線學(xué)習(xí)分享的學(xué)習(xí)平臺!

杏林同學(xué)錄(7)

[摘要]留言簿部分: 班級成員留言簿: 顯示留言:class/notebook/index.php <? session_start(); // 開始session if(!session_is_registered("userregister") (userregist...
留言簿部分:
   班級成員留言簿: 顯示留言:class/notebook/index.php
<?
session_start(); // 開始session
if(!session_is_registered("userregister") ($userregister==""))//檢查是否注冊,如userregister未注冊或session為空值,重新注冊.
{
echo "<a href='../index.php'>請重新注冊<BR>";
exit;
}
?>
<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<TITLE>留言簿</TITLE>
<style type="text/css">
<!--
.blue9 {  font-size: 9pt; color: #0099FF; text-decoration: none}
.black9 {  font-size: 9pt; text-decoration: none}
.purple10 {  font-size: 10pt; color: #9900FF; text-decoration: none}
.white12 {  font-size: 12pt; color: #FFFFFF; text-decoration: none}
a:visited {  color: #FFFFFF}
a:link {  color: #FFFFFF}
-->
</style>
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<?php
include ("../config.php");
$result = mysql_query("SELECT * FROM notebook",$db);
$row=mysql_num_rows($result);//查看查詢結(jié)果有多少行
$max=$row; //帖子總數(shù)
//設(shè)每頁顯示10篇,可自行設(shè)定,$p總頁數(shù),$page第幾頁,$low 從第幾行開始讀,$x 讀取幾行
if (!$page){ $page=1;}//$page默認(rèn)值為1
$p=ceil($max/10);//頁數(shù)為$max/10的最大整數(shù)
$low=10*($page-1);
if($page==$p&&($max%10)<>0){$x=($max%10);} else {$x=10;}//如果是最后一頁,且不是10的整倍數(shù),讀取$max除以10的余數(shù),否則取10
if($max==0){$x=0;}//如果沒有帖子,$x取0
$result = mysql_query("select * from notebook ORDER BY time DESC limit $low,$x",$db);//按照帖子的時間降序查詢
?>
<table width="98%" border="0" cellspacing="0" cellpadding="0" height="61">
  <tr>  
    <td height="62" width="34%"><img src=http://www.okasp.com/techinfo/".image/classlogo.gif" width="224" height="60"  border="0"></td>
    <td height="62" width="66%">  
      <div align="center"><img src=http://www.okasp.com/techinfo/".image/note.gif" width="410" height="60"><img src=http://www.okasp.com/techinfo/".image/y1.gif" width="60" height="60"></div>
    </td>
  </tr>
</table>
<table width="95%" border="1" cellspacing="0" cellpadding="0" height="253" bordercolordark="#FFFFFF" bordercolorlight="#003399" align="center">
  <tr>  
    <td height="250">  
      <div align="center"></div>
      <table width="95%" border="0" cellspacing="0" cellpadding="0" height="32" bgcolor="#3366FF">
        <tr>  
          <td width="26%" class="white12" height="23"><a href="../guest.php" class="white12">首頁</a>  
            &gt; 留言簿</td>
          <td width="48%" class="white12" height="23">  
            <?php
          echo "帖子總數(shù): &nbsp;",$max," &nbsp;&nbsp;第";
          for ($n=1;$n<=$p;$n++){
          echo "<a href=index.php?page=$n>$n</a>&nbsp;";
          }
          echo "頁";
          ?>
          </td>
          <td width="15%" height="23"><a href="addnote.php"><img src=http://www.okasp.com/techinfo/".image/newthread.gif" width="91" height="21" border="0"></a></td>
          <td width="11%" height="23"><a href="delnote.php"><span class="white12">留言管理</span></a></td>
        </tr>
      </table>  
<?php
   for ($i=0;$i<=($x-1);$i++) {
   $user=mysql_result($result,$i,'user');
   $time=mysql_result($result,$i,'time');
   $ip=mysql_result($result,$i,'ip');
   $title=mysql_result($result,$i,'title');
   $nnote=mysql_result($result,$i,'nnote');
   $yresult = mysql_query("SELECT * FROM user where user='$user'",$db);//讀取成員數(shù)據(jù)庫
   $name=mysql_result($yresult,0,'name');
   $signature=mysql_result($yresult,0,'signature');//讀取個人簽名
   $email=mysql_result($yresult,0,'email');
   $face=mysql_result($yresult,0,'face');
   $face='../image/face/icon'.$face;
     
echo "<table width='100%' border='0' cellspacing='0' cellpadding='0' height=107' bordercolor='#FFFFFF'> <tr bgcolor='#eeeeee'>";  
echo "<td width='10%' height='33' bgcolor='#eeeeee' class='blue9'>&nbsp;<img src='http://www.okasp.com/techinfo/$face.gif' width='32' height='32'></td>";
echo        "<td width='16%' height='33' bgcolor='#eeeeee' class='blue9'>留言人:$name</td>";
echo        "<td width='41%' height='33' bgcolor='#eeeeee' class='blue9'>發(fā)表于:$time</td>";
echo        "<td width='12%' height='33' bgcolor='#eeeeee' class='blue9'><a href='mailto:$email'><img src='http://www.okasp.com/image/email.gif' width='16' height='16' border=0></a></td>";
echo        "<td width='21%' height='33' class='blue9'><img src='http://www.okasp.com/image/ip.gif' width='13' height='15'> &nbsp;$ip</td>  </tr> <tr>";  
echo        "<td colspan='5' class='purple10' height='33'>標(biāo)題:$title</td> </tr>";
echo        "<tr bgcolor='#ffffff'><td colspan='5' class='black9' height='37'>留言內(nèi)容:$nnote<BR>----------------------<BR>$signature</td></tr></table>";
}
mysql_close($db);
?>     
    </td>
</tr>
</table>
</BODY>
</HTML>
添加留言:class/notebook/addnote.php
<?
session_start(); // 開始session
if(!session_is_registered("userregister") ($userregister==""))//檢查是否注冊,如userregister未注冊或session為空值,重新注冊.
{
echo "<a href='../index.php'>請重新注冊<BR>";
exit;
}
?>
<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%"><img src=http://www.okasp.com/techinfo/".image/classlogo.gif" width="224" height="60" border="0"></td>
    <td height="62" width="66%">  
      <div align="center"><img src=http://www.okasp.com/techinfo/".image/note.gif" width="410" height="60"><img src=http://www.okasp.com/techinfo/".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地址
$title=strip_tags($top);
$nnote=nl2br(strip_tags($content));//先去掉html標(biāo)記,再將換行符轉(zhuǎn)成 <br>。
if (!$title !$nnote){           //檢查是否填寫完整
      echo "對不起,您必須填所有內(nèi)容!<BR>"."<a href='javascript:history.back()'>返回</a>";
      exit; }
   //寫入數(shù)據(jù)庫
$sql="INSERT INTO notebook (user,time,ip,title,nnote) VALUES ('$userregister','$time','$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="../../main.php" class="white12">首頁</a>  
      &gt; <a href="index.php" class="white12">留言簿</a> &gt; 添加留言</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>  
              <div align="center">標(biāo)題<br>
                <input type="text" name="top" size="50">
                <br>
                內(nèi)容<br>
                <textarea name="content" cols="50" rows="6"></textarea>
                <br>
                <input type="submit" name="submit" value="確定">
                <input type="reset" name="cancel" value="重寫">
              </div>
            </td>
          </tr>
        </table>
              </form>
    </td>
  </tr>
</table>
<p><a href="main.php?user=<? echo $user?>" class="white12"><br>
  </a></p>
</BODY>
</HTML>



標(biāo)簽:杏林同學(xué)錄(7) 

相關(guān)文章

主站蜘蛛池模板: 四虎www成人影院观看 | 中国与黑人xxxx视频 | 日韩在线观看网址 | 又粗又硬又大又爽免费视频播放 | 四虎影院永久网址 | 日本一区二区三区免费高清在线 | 越南一级淫片高清视频 | 亚洲视频在线观看网站 | 亚洲最新在线视频 | 中文字幕第一页在线播放 | 中文字幕日韩三级 | 日本v片免费一区二区三区 日本vs欧美一区二区三区 | 亚洲第一福利视频 | 天堂伦理片 | 日本成人激情视频 | 欧美特黄a级高清免费看片 欧美特黄a级高清免费大片 | 最近2019中文字幕大全视频一页 | 亚洲视频在线观看 | 天干天夜啪天天碰 | 色综合91 | 亚洲综合色网站 | 亚洲成人福利在线观看 | 三级自拍视频 | 小说区 亚洲 自拍 另类 | 日韩大片免费观看视频播放 | 婷婷色综合成人成人网小说 | 日韩精品视频美在线精品视频 | 三级亚洲 | 天天看天天色 | 亚洲精品成人a | 四虎4hu影库免费永久国产 | 全免费午夜一级毛片一级毛 | 综合色在线 | 日本另类αv欧美另类aⅴ | 亚洲福利视频一区二区三区 | 在线免费视频一区二区 | 偷拍免费视频 | 色爱区综合小说 | 四虎影视在线影院4hutv | 日本香蕉视频在线观看 | 日韩成人免费在线视频 |