Home  >  Article  >  Backend Development  >  include 里的链接解决办法

include 里的链接解决办法

WBOY
WBOYOriginal
2016-06-13 13:36:511000browse

include 里的链接
各位大侠,我在主界面用include 引用了一个PHP界面,里面有分页显示,但是页数的超链接应该怎么实现啊?

------解决方案--------------------
把分页封装成类,或者函数。或者直接网上找个现成的分页来用
------解决方案--------------------
将你数据库的连接封装成字符串方法。可以写个共有的。每次需要的时候可以调用那个方法。

PHP code
private function setpagestr(){
        $temstr=" ";
        if($this->curpage>1){
            $temstr.='<a href="'.%24this->pageurl.'">首页</a> <a href="'.%24this->pageurl.'&'.PAGECUT.'='.(%24this->curpage-1).'">'.$this->pre_str.'</a> ';
        }
        if($this->curpagegettotalepage()){
            $temstr.='<a href="'.%24this->pageurl.'&'.PAGECUT.'='.(%24this->curpage+1).'">下一页</a> ';
            $temstr.='<a href="'.%24this->pageurl.'&'.PAGECUT.'='.(%24this->gettotalepage()).'">末页</a>';
        }
        $temstr.='  当前第<font color="#FF0000">'.$this->curpage.'</font>页/共<font color="#FF0000">'.$this->gettotalepage().'</font>页  共<font color="#FF0000">'.$this->totalerows.'</font>条记录';
        $this->pagestr=$temstr;
    }
<br><font color="#e78608">------解决方案--------------------</font><br>主界面 include 引用的 PHP界面,已经与主界面融合为一体<br><br>主界面点击页数的时候,实际传递到传递到主界面,引用界面中可正常获取<br> <div class="clear">
                 
              
              
        
            </div>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn