2、输出链接如下
- $fieldandval['dalei']='<dt>大类:</dt><dd>|==|全部,0##东城,1##朝阳,2##崇文,3##宣武,4##海淀,5##丰台,6';
- if($_GET['dalei']==1){
- $fieldandval['xiaolei']='<dt>小类:</dt><dd>|==|全部,##1-10,1##11-20,2##21-30,3##31-40,4##41-50,5##50岁以上,6';
- }
3、最终呈现链接:www.XXXX.com/serve/0_29_1_1_0.html
- //选项内容
- $valallstr='';
- $vr=explode('##',$vsayr[1]);
- $vcount=count($vr);
- for($vi=0;$vi<$vcount;$vi++)
- {
- $vtr=explode(',',$vr[$vi]);
- if($getval==$vtr[1])
- {
- $css=$changefieldandcss;
- }
- else
- {
- $css=$fieldandcss;
- }
- $vtr=explode(',',$vr[$vi]); if($vtr[1]=='' || $vtr[1]==null){$vtr[1]=0;}
- $dalei_value=news_value('dalei',$i,0,$vtr[1]);
- $xiaolei_value=news_value('xiaolei',$i,1,$vtr[1]);
- if($i==0){
- $valallstr.=$valexpr[0].'<a href="'.$public_r['newsurl'].'serve/0_'.$classid.''.$dalei_value.$xiaolei_value.'_0.html">'.$vtr[0].'</a>'.$valexpr[1];
- }
- }
- $allstr.=$fieldexpr[0].$vsayr[0].$valallstr.$fieldexpr[1];
- }
- $allstr=str_replace('<!--url.add-->',$urladd,$allstr);
- echo $allstr;
- }
- function news_value($field,$ii,$iii,$vrtss)//新增函数
- {
- if($_GET[$field])
- {
- $getval=htmlspecialchars($_GET[$field],ENT_QUOTES);
- //$news_values='-'.urlencode($getval);
- $news_values='_'.$getval;
- }
- else
- {
- $news_values='_0';
- }
- if($ii==$iii)
- {
- $news_values='_'.$vrtss;
- }
- return $news_values;
- }
4、伪静态规则如下:
- rewrite ^/(.*)serve/0_(.+?)_(.+?)_(.+?)_(.+?).html$ /$1/e/action/ListInfo.php?&classid=$2&tempid=9&ph=1&dalei=$3&xiaolei=$4&page=$5;