![]() |
|
首页 │ Apache │ Linux│ Java│ MySQL│ 注册│帮助 | |||
Notice: Use of undefined constant go - assumed 'go' in E:\homework\example\fenye2.php on line 8
Notice: Use of undefined constant curpage - assumed 'curpage' in
文档:
<?
function page($sql)
{
global $cur_page,$total_page_nums,$last_page,$next_page;
$result =mysql_query($sql);
$num=mysql_num_rows($result);
$total_page_nums=ceil($num/5-1);
if($_POST[go])
$cur_page=$_POST[curpage];
else
$cur_page=$_GET[$cur_page];
if(!isset($cur_page))
$cur_page=1;
$last_page=$cur_page-1;
if($last_page<1)
$last_page=1;
$next_page=$cur_page+1;
if($next_page>$total_page_nums)
$next_page=$total_page_nums;
$pages=$cur_page*5;
$sql.=" limit $pages,5";
return $sql;
}
function disp()
{
global $cur_page,$total_page_nums,$last_page,$next_page,$PHP_SELF;
$control ="共$total_page_nums页 ";
$control .="首页| ";
$control .="上页| ";
$control .="下页| ";
$control .="末页\n";
echo "
}
?>
该怎么改啊?

