挑战最棒的留言本的源码(五)

2016-01-29 14:27 2 1 收藏

挑战最棒的留言本的源码(五),挑战最棒的留言本的源码(五)

【 tulaoshi.com - PHP 】

  <html
<title留言本</title
<body bgcolor=white
<head
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"
<style type="text/css"

<!--
td {  font-family: "宋体", "serif"; font-size: 9pt; font-weight: normal}
a:link {  text-decoration: none}
a:hover {  color: #999999}
a:visited {  text-decoration: none; font-weight: normal}
body {  font-family: "宋体", "serif"; font-size: 11pt}
tr {  font-family: "宋体", "serif"; font-size: 11pt}
.unnamed1 {  font-size: 9pt; font-weight: bold}
.p9 {  font-family: "宋体"; font-size: 11pt}
.unnamed2 {  font-size: 11pt}
--
</style
</head
<h1<center<font color="green" size=7留言信息</font</center</h1

<?php  
      require('config.php');  
?


<?php


$initial_record=0;
$sort_field='key_liuyan';
$sort_direction='DESC';

if (strlen($arr_request['initial_record']))
   {  
     $initial_record=$arr_request['initial_record'];
     $sort_field=$arr_request['sort_field'];
     $sort_direction=$arr_request['sort_direction'];

   }


$str_sql_all="select count(*) as number_of_records from $table_name ";

$result=mysql_db_query($db_name,$str_sql_all,$id_link);

if (!result)
   { affy_error_exit('SQL select execution has failed.');}

$record=@mysql_fetch_object($result);

$number_of_records=$record-number_of_records;

if (strlen($sort_field)==0)
  {
    $str_sql="select * from $table_name  
              limit $initial_record,$number_records_to_display ";

  }

else  
{

   $str_sql="select * from $table_name order by $sort_field $sort_direction
             limit $initial_record,$number_records_to_display ";
}


$result=mysql_db_query($db_name,$str_sql,$id_link);

if (!$result)
   { affy_error_exit('SQL select execution has failed.');}

$number_of_records_on_current_page=@mysql_num_rows($result);

if ($number_of_records<1)
  {  echo '<p表中没有数据!<p';}
else
  {
    $next_index=$initial_record+$number_records_to_display;
     
    if ($next_index$number_of_records)
         $next_index=$number_of_records;

     

    $prev_index=$initial_record-$number_records_to_display;

    if ($prev_index<0)
       {
          $prev_index=0;
       }  
    

  }
   
echo "<center";
echo "<table border=0<tr bgcolor=#f1f1f1<td width=24% align=left";

if ($initial_record!=0)
   {
     $t1="initial_record=$prev_index";
     $sort="sort_field=$sort_field";
     $asc="sort_direction=$sort_direction";
  &

来源:https://www.tulaoshi.com/n/20160129/1493369.html

延伸阅读
标签: Web开发
最近一直在用php+dbfile开发blog,开发过程中学到了不少东西,于是就试着写了一个小留言本。 这个留言本采用php+dbfile,不需要使用数据库,可以放在blog中使用,比如http://www.customyze.com,这个blog中的Tag Board就是这个留言本。 整个留言本需要四个文件,分别是:board.php、index.php、config.php、admin.php。 board.php用来存储...
标签: PHP
  现在我们来讲一下reply.php的代码: --------------------------------- //reply.php <?   function check_strlen_long($txt) { $len=strlen($txt); $count=0; for ($i=0;$i<$len;$i++) { if (ord($txt[$i])<128)   { $count=$count+1;}   if (ord($txt[$i])==10 or ord($tx...
标签: PHP
  guestbook.php: <head <meta http-equiv="Content-Language" content="zh-cn" <meta http-equiv="Content-Type" content="text/html; charset=gb2312" <title</title <STYLEA:link {         COLOR: #002878; TEXT-DECORATI...
标签: PHP
  下面是配置说明: 为了配置的方便,重新整理了代码,现在已经把全部的需要设置的参数都放在config.php文件里了,配置起来应该很简单,里面有详悉的说明. 目标:在十分种内搞定你的留言本!!! 1: 建立一个数据库(要主页提供数据库空间) 一般的有phpMyAdmin开放源玛的前端.创建以来很简单的. 取好名字后,记得把confi...
标签: ASP
  五、建立显示XML数据的ASP文件(index.asp) 这个文件要实现的功能就是读取并显示XML数据,首先创建一个XML对像然后把XML读入内存中,利用DOM分离出我们所要的数据。 <% strSourceFile = Server.MapPath("/") & "\List.xml" '获取XML文件的路径这里根据你的虚拟目录不同而不同 Set objXML = Server.Create...

经验教程

696

收藏

73
微博分享 QQ分享 QQ空间 手机页面 收藏网站 回到头部