喜悦国际村 
» 游客:  注册 | 登录 | 搜索 | 统计 | 帮助

RSS 订阅当前论坛  

喜悦证交所已经关闭

上一主题 下一主题
     
标题: 分页为何无法传递参数?  
 
WeRender
新手上路
Rank: 1



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>
2006-7-26 06:49 PM#1
查看资料  发短消息  顶部
 
chinahtml
金牌会员
Rank: 6Rank: 6


UID 69683
精华 0
积分 1012
帖子 1019
金钱 1012 喜悦币
威望 0
人脉 0
阅读权限 70
注册 2006-3-16
状态 离线
[推荐阅读] 逐行(没有固定次序)写MySQL数据库,帮我提升一下效率!
print_r($_GET);看看有多少参数传递过去了。



-地振山冈,一派溪山千古秀
-门朝大海,山合河水万年流
2006-7-26 06:52 PM#2
查看资料  发短消息  顶部
 
mayi
中级会员
Rank: 3Rank: 3
初级会员


UID 68189
精华 0
积分 332
帖子 344
金钱 332 喜悦币
威望 0
人脉 0
阅读权限 30
注册 2006-1-20
状态 离线
[推荐阅读] 招聘php软件开发工程师 网站美工设计师
require './fqq.php';   
require '../fqq.php';
2006-7-26 06:56 PM#3
查看资料  Blog  发短消息  顶部
 
WeRender
新手上路
Rank: 1



UID 73415
精华 0
积分 6
帖子 5
金钱 6 喜悦币
威望 0
人脉 0
阅读权限 10
注册 2006-5-15
状态 离线
[推荐阅读] [上海]高薪诚聘 月薪10000-15000 PHPER
回复 #2 chinahtml 的帖子

我点第二页时,结果:
Array ( [page] => 2 )
2006-7-26 06:57 PM#4
查看资料  发短消息  顶部
 
WeRender
新手上路
Rank: 1



UID 73415
精华 0
积分 6
帖子 5
金钱 6 喜悦币
威望 0
人脉 0
阅读权限 10
注册 2006-5-15
状态 离线
[推荐阅读] 帮我看一下这个地址


QUOTE:
原帖由 mayi 于 2006-7-26 06:56 PM 发表
require './fqq.php';   
require '../fqq.php';
这点没有问题,可能是发上时不小心修改了。
2006-7-26 06:58 PM#5
查看资料  发短消息  顶部
 
c1a1o1
版主
Rank: 7Rank: 7Rank: 7
一品带刀护卫


UID 68669
精华 0
积分 8936
帖子 2357
金钱 8936 喜悦币
威望 0
人脉 0
阅读权限 100
注册 2006-2-17
状态 离线
[推荐阅读] 请问PHP中除了用md5()之外还有没有其他加密函数
分页不只要分成了数字,更重要搜索得到的一些参数在所分页要得到体现!



生日礼物送什么www.feichanglipin.cn
生日礼物      补肾
2006-7-26 07:00 PM#6
查看资料  Blog  发短消息  QQ . .   顶部
 
WeRender
新手上路
Rank: 1



UID 73415
精华 0
积分 6
帖子 5
金钱 6 喜悦币
威望 0
人脉 0
阅读权限 10
注册 2006-5-15
状态 离线
[推荐阅读] 帮忙看下这个数据库表创建错在哪?


QUOTE:
原帖由 c1a1o1 于 2006-7-26 07:00 PM 发表
分页不只要分成了数字,更重要搜索得到的一些参数在所分页要得到体现!
这是统计的结果:

搜索软件 | 搜到合计60个 | 首页 上一页 下一页 尾页 | 1/6 10个/页

问题在于:

点下一页,或者尾页时,显示不出。
2006-7-26 07:02 PM#7
查看资料  发短消息  顶部
 
WeRender
新手上路
Rank: 1



UID 73415
精华 0
积分 6
帖子 5
金钱 6 喜悦币
威望 0
人脉 0
阅读权限 10
注册 2006-5-15
状态 离线
[推荐阅读] 想学PHP框架,问各位N人几个问题
回复 #7 WeRender 的帖子

已经解决,参数传递的问题。感谢。
2006-7-26 07:26 PM#8
查看资料  发短消息  顶部
     


  可打印版本 | 推荐给朋友 | 订阅主题 | 收藏主题 | 开通个人空间  


 




Powered by Discuz! 6.1.0  © 2001-2010 Comsenz Inc.
Processed in 0.050523 second(s), 6 queries

(冀ICP备05009913号) 管理员:sadly 邮箱/MSN: sadly@phpx.com QQ:824008(长隐) 清除 Cookies - - Archiver - WAP