PHP代碼如下所示
<!
<?php require_once(
<?php
//分頁的計算
$maxRows_rs_articles =
$pageNum_rs_articles =
if (isset($_GET[
{
$pageNum_rs_articles = $_GET[
}
$startRow_rs_articles = $pageNum_rs_articles * $maxRows_rs_articles; //計算起始記錄數
//讀取文章信息
mysql_select_db($database_conn
$query_rs_articles =
last_upt_time DESC
$query_limit_rs_articles = sprintf(
$startRow_rs_articles
$rs_articles = mysql_query($query_limit_rs_articles
$row_rs_articles = mysql_fetch_assoc($rs_articles);
//設定分頁頁碼
if (isset($_GET[
{
$totalRows_rs_articles = $_GET[
}
else //否則執行SQL語句計算
{
$all_rs_articles = mysql_query($query_rs_articles);
$totalRows_rs_articles = mysql_num_rows($all_rs_articles);
}
$totalPages_rs_articles = ceil($totalRows_rs_articles/$maxRows_rs_ articles)
//讀取文章類別信息
mysql_select_db($database_conn
$query_rs_types =
$rs_types = mysql_query($query_rs_types
$row_rs_types = mysql_fetch_assoc($rs_types);
$totalRows_rs_types = mysql_num_rows($rs_types);
//讀取網站配置信息
mysql_select_db($database_conn
$query_rs_config =
id=templates
$rs_config = mysql_query($query_rs_config
$row_rs_config = mysql_fetch_assoc($rs_config);
$totalRows_rs_config = mysql_num_rows($rs_config);
//驗證用戶權限
session_start();
$loginFormAction = $_SERVER[
if (isset($accesscheck)) //檢查是否已經登錄
{
$GLOBALS[
session_register(
}
right
From:http://tw.wingwit.com/Article/program/PHP/201311/21406.html