当前位置:编程学习 > 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(和PHP搭配之最佳组合)_db_query($db_name,$str_sql_all,$id_link);

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

$record=@MySQL(和PHP搭配之最佳组合)_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(和PHP搭配之最佳组合)_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(和PHP搭配之最佳组合)_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;
       }  
补充:Web开发 , php ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,