WeRender
新手上路

UID 73415
精华
0
积分 6
帖子 5
金钱 6 喜悦币
威望 0
人脉 0
阅读权限 10
注册 2006-5-15
状态 离线
|
分页为何无法传递参数?
分页正常,就是我调用页码时,出现错误。
比如:我点下一页,会出现”你要找什么?“的提示。把此行删除以后,提示没有搜索到任何内容。页码分的非常正确,共多少页也显示,就是不能调用某一页。
哪位高手帮忙看一下,问题出在什么地方了?
<?
require './fqq.php';
if (empty($keyword)) {echo" 你要找什么? ";exit;}
$listtosearch=file("./data/list.php");
$count=count($listtosearch);
for ($j=0; $j<$count; $j++) {
list($a,$b,$c,$d,$e,$f)=explode("|",$listtosearch[$j]);
if($action=='title'){
if($sclass=='all') {
if (strpos($d,$keyword) !== false ) {
$result[] = $listtosearch[$j];
$resultcount++;
}
}else{
if ($a==$sclass && strpos($d,$keyword) !== false ) {
$result[] = $listtosearch[$j];
$resultcount++;
}
}
}elseif($action=='content'){
$file_name=chop($c);
$a_info=@file("./data/$file_name.php"); list($txt_category_id,$txt_class_id,$txtshowname,$txtfilename,$txtshow,$txtfilename1,$txtshow1,$txtfilename2,$txtshow2,$txtfilename3,$txtshow3,$fromurl,$size,$order,$hot,$hots,$hide,$usrtool,$runsystem,$txtnote,$times,$imgurl)=explode("|",$a_info[1]);
if($sclass=='all') {
if (strpos($txtnote,$keyword) !== false ) {
$result[] = $listtosearch[$j];
$resultcount++;
}
}else{
if ($a==$sclass && strpos($txtnote,$keyword) !== false ) {
$result[] = $listtosearch[$j];
$resultcount++;
}
}
}
}
$class_name="搜索软件";
if (empty($page)) $page=1;
if ($page <1) $page=1;
settype($page, integer);
$perpage=10;
?>
<table width="550" border="0" cellspacing="4" cellpadding="0" align="center" height="20">
<tr>
<td>您的位置:<a href=index.php>首页</a> -> <?=$class_name?></td>
</tr>
</table>
<table width="550" border="0" cellspacing="0" cellpadding="0" align="center" height="60">
<tr>
<td width="20"> </td>
<td valign=top>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#dfe6ee" height="20">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> 软件名称</td>
<td width="14%" align=center>日期</td>
<td width="10%" align=center>人气</td>
<td width="10%" align=right>文件大小 </td>
</tr>
</table></td>
</tr>
<tr><td height=5></td></tr>
<tr>
<td height="50">
<?
$countnum=count($result);
$list_soft='';
$count=$countnum;
if($count!=0){
if ($count%$perpage==0) $maxpageno=$count/$perpage;
else $maxpageno=floor($count/$perpage)+1;
if ($page>$maxpageno) $page=$maxpageno;
$pagemin=min( ($page-1)*$perpage , $count-1);
$pagemax=min( $pagemin+$perpage-1, $count-1);
for ($i=$pagemin; $i<=$pagemax; $i++) {
$detail=explode("|",$result[$i]);
$file_name=chop($detail[2]);
$a_info=@file("./data/$file_name.php"); list($txt_category_id,$txt_class_id,$txtshowname,$txtfilename,$txtshow,$txtfilename1,$txtshow1,$txtfilename2,$txtshow2,$txtfilename3,$txtshow3,$fromurl,$size,$order,$hot,$hots,$hide,$usrtool,$runsystem,$txtnote,$times,$imgurl)=explode("|",$a_info[1]);
$txtnote=str_replace("<br>"," ",$txtnote);
if (strlen($txtnote)>=50) $txtnote=substr($txtnote,0,47)." ...";
$txtshowname = str_replace($keyword,"<font color=red>$keyword</font>",$txtshowname);
$txtnote = str_replace($keyword,"<font color=red>$keyword</font>",$txtnote);
list($viewnum,$downnum,$tviewnum,$tdownnum,$pinfeng,$viewtimes)=explode("|",$a_info[2]);
$times=get_date($times);
?>
<table width="99%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="20"><a href="display.php?id=<?echo $file_name;?>"><b><?echo $txtshowname?></b></a></td>
</tr>
<tr>
<td height="40" align="right">
<table width="98%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="20">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><?echo $txtnote;?></td>
<td width="14%" align=center><?echo $times;?></td>
<td width="10%" align=center><?=$viewnum?></td>
<td width="10%" align=right><?echo $size;?> </td>
</tr>
</table> </td>
</tr>
<tr>
<td height="20">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="100%"><b>操作系统</b>:<?echo $runsystem;?> <b>授权方式</b>:<?echo $order;?></td>
</tr>
</table> </td>
</tr>
</table> </td>
</tr>
<tr>
<td height="1" bgcolor="#FFCC99"></td>
</tr>
</table>
<? }
}else {echo "对不起,没有搜索到相关的软件";}
?></td>
</tr>
<form method=post action=search.php?page=$page>
<tr>
<td bgcolor="#dfe6ee" height="22"> 搜索软件 |
<?
if ($maxpageno<=1) echo " 搜到合计{$countnum}个 | 只有一页";
else {
$nextpage=$page+1;
$previouspage=$page-1;
echo " 搜到合计{$countnum}个 | ";
if ($page<=1) echo " 首页 上一页 <a href=?&page=$nextpage>下一页</a> <a href=serach.php?&page=$maxpageno>尾页</a> ";
elseif($page>=$maxpageno) echo " <a href=search.php?&page=1>首页</a> <a href=search.php?&page= $previouspage>上一页</a> 下一页 尾页 ";
else echo " <a href=search.php?&page=1>首页</a> <a href=search.php?&page= $previouspage>上一页</a> <a href=search.php?&page=$nextpage>下一页</a> <a href=search.php?&page=$maxpageno>尾页</a> ";
echo " | $page/$maxpageno 10个/页 | 转到 <select name='page' size='1' style=\"border: 1px solid #429234; background-color: #FAFDF9\" onChange='javascript:submit()'>";
for ($j=1; $j<=$maxpageno; $j++) {echo "<option value='".$j."'>第".$j."页</option>";
}
echo "</select>";
}
?></td>
</tr></form>
</table> </td>
</tr>
</table>
|
|