当前位置:编程学习 > php >>

杏林同学录(七)

留言簿部分:
   班级成员留言簿: 显示留言: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(和PHP搭配之最佳组合)_query("SELECT * FROM notebook",$db);
$row=MySQL(和PHP搭配之最佳组合)_num_rows($result);//查看查询结果有多少行
$max=$row; //帖子总数
//设每页显示10篇,可自行设定,$p总页数,$page第几页,$low 从第几行开始读,$x 读取几行
if (!$page){ $page=1;}//$page默认值为1
$p=ceil($max/10);//页数为$max/10的最大整数
$low=10*($page-1);
if($page==$p&&($max%10)<>0){$x=($max%10);} else {$x=10;}//如果是最后一页,且不是10的整倍数,读取$max除以10的余数,否则取10
if($max==0){$x=0;}//如果没有帖子,$x取0
$result = MySQL(和PHP搭配之最佳组合)_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="/edu/UploadPic/2008-2/2008215175827122.gif"" width="224" height="60"  border="0"></td>
    <td height="62" width="66%">  
      <div align="center"><img src="/edu/UploadPic/2008-2/2008215175827725.gif"" width="410" height="60"><img src="/edu/UploadPic/2008-2/2008215175827407.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>  
补充:Web开发 , php ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,