php
include "sql.php" ;
$perNumber 5;
//每页显示的记录数
$
//获得当前的页面值
$count mysql_query "select count * from userinfo" ;
//获得记录总数
$rs mysql_fetch_array $count ;
$totalNumber $rs[0];
$total
//计算出总页数
if !isset $
$ //如果没有值,则赋值1
$startCount $
//分页开始,根据此方法计算出开始的记录 div style "text-align:center;color:red;" php
$result mysql_query "select * from userinfo limit $startCount,$perNumber" ;
//根据前面的计算出开始的记录和记录数
$i $startCount;
while $row mysql_fetch_array $result echo $i." ";
echo "username:".$row['username']." ";
echo "password:".$row['password']." ";
//显示数据库的内容
$i++;
if $
//页数不等于1 a href "paging.php?
a href "paging.php?
!--显示上一页-- php for $i 1;$i $total
//循环显示出页面 a href "paging.php php echo $i ; php if $
a href "paging.php?
a href "paging.php php php function paging $perNumber,$table
$
//获得当前的页面值
$count mysql_query "select count * from $table" ;
//获得记录总数
$rs mysql_fetch_array $count ;
$totalNumber $rs[0];
$total
//计算出总页数
if !isset $
$ //如果没有值,则赋值1
$startCount $
//分页开始,根据此方法计算出开始的记录
$result mysql_query "select * from $table limit $startCount,$perNumber" ;
//根据前面的计算出开始的记录和记录数
while $row mysql_fetch_array $result echo "username:".$row['username']." ";
echo "password:".$row['password']." ";
//显示数据库的内容
if $
//页数不等于1 a href "paging.php?
a href "
!--显示上一页-- php for $i 1;$i $total
//循环显示出页面 a href "
?php echo $i ; php if $
a href "
a href "paging.php php //添加功能
meta http-equiv "Content-Type" content "text/html; charset UTF-8" php session_start ; php
//include "publicsql.php" ;
/*
$title addslashes $_POST['title'] ;
$content $_POST['content'];
$updatetime date 'Y-m-d H:i:s',time ;
$data array 'title' $title,
'content' $content,
'updatetime' $updatetime
;
$tablename 'post';
$num inserts $tablename, $data ;
if $num 1 echo ' alert "你的帖子已成功发表" ; ';
echo ' window.location "log.html"; '; else echo ' alert "发帖失败" ; ';
echo ' window.location "post.ph