Home Backend Development PHP Tutorial PHP 传值的有关问题

PHP 传值的有关问题

Jun 13, 2016 pm 12:08 PM
gt index nbsp

PHP 传值的问题

1

<br />public function index(){<br />       $Dao = M("zhaopin");<br />     // 构造查询条件<br />       $condition['Position'] = $_GET['Position'];<br />     $condition['Recruitment'] = $_GET['Recruitment'];<br />       $condition['Position'] = array('like',"%".$_GET['Position']."%");<br />       $condition['Recruitment'] = array('like',"%".$_GET['Recruitment']."%");<br />     // 计算总数<br />     $count = $Dao->where($condition)->count();<br />        // 导入分页类<br />        import("ORG.Util.Page");<br />        // 实例化分页类<br />       $p = new Page($count,40);<br />       // 获取查询参数<br />       $map['Position'] = $_GET['Position'];<br />       $map['Recruitment'] = $_GET['Recruitment'];<br />     foreach($map as $key=>$val) {<br />            $p->parameter .= "$key=".urlencode($val)."&";<br />        }<br />       // 分页显示输出<br />       $page = $p->show();<br />      // 当前页数据查询<br />      $list = $Dao->where($condition)->order('id DESC')->limit($p->firstRow.','.$p->listRows)->select();<br />           // 赋值赋值<br />      $this->assign('page', $page);<br />        $this->assign('list', $list);<br />        $this->display();<br />}<br />

Copy after login

1

<br /><a href="/index.php/Zhaopin/" >全部</a><br /><a href="/index.php/Zhaopin/index?Position=物流专员/助理">物流专员/助理</a><br /><a href="/index.php/Zhaopin/index?Position=物流经理/主管">物流经理/主管</a><br /><a href="/index.php/Zhaopin/index?Position=物流总监">物流总监</a><br /><a href="/index.php/Zhaopin/index?Position=调度员">调度员</a><br /><a href="/index.php/Zhaopin/index?Position=快递员">快递员</a><br /><a href="/index.php/Zhaopin/index?Position=仓库管理员">仓库管理员</a><br /><a href="/index.php/Zhaopin/index?Position=仓库经理/主管">仓库经理/主管 </a><br /><a href="/index.php/Zhaopin/index?Position=装卸/搬运工">装卸/搬运工</a><br /><a href="/index.php/Zhaopin/index?Position=供应链管理">供应链管理</a><br /><a href="/index.php/Zhaopin/index?Position=单证员">单证员 </a><br /><a href="/index.php/Zhaopin/index?Position=国际货运">国际货运</a><br /><a href="/index.php/Zhaopin/index?Position=其它职位">其它职位</a></dd><br /><br /><br /><a href="/index.php/Zhaopin/">全深圳</a> <br /><a href="/index.php/Zhaopin/index?Recruitment=罗湖区">罗湖区</a><br /><a href="/index.php/Zhaopin/index?Recruitment=福田区">福田区</a><br /><a href="/index.php/Zhaopin/index?Recruitment=南山区">南山区</a><br /><a href="/index.php/Zhaopin/index?Recruitment=盐田区">盐田区</a><br /><a href="/index.php/Zhaopin/index?Recruitment=宝安区">宝安区</a><br /><a href="/index.php/Zhaopin/index?Recruitment=龙岗区">龙岗区</a><br /><a href="/index.php/Zhaopin/index?Recruitment=光明新区">光明新区</a><br /><a href="/index.php/Zhaopin/index?Recruitment=坪山新区">坪山新区</a><br /><a href="/index.php/Zhaopin/index?Recruitment=大鹏新区">大鹏新区</a><br /><a href="/index.php/Zhaopin/index?Recruitment=龙华新区">龙华新区</a><br /><a href="/index.php/Zhaopin/index?Recruitment=深圳周边">深圳周<br />

Copy after login


点击上面的 任何一个  在点击下面的 任何一个 2个 怎么传值呢  
我要的是/index.php/Zhaopin/index?Position=其它职位&Recruitment=坪山新区
------解决思路----------------------

------解决思路----------------------

引用:
Quote: 引用:


点击的时候 才能获取Recruitment  这样的写法 是写死的 不可以

你是post 还是get
------解决思路----------------------
这个不是前端构造URL时的问题吗?
------解决思路----------------------
你get两次
你应该是想得到在地址栏点击后在地址栏出现这个吧index.php/Zhaopin/index?Position=其它职位&Recruitment=罗湖区""
------解决思路----------------------
这个可以用jQuery的方式做,像jQuery.address.parameter(key,value)这样,就会在地址栏中拼接上参数和值,还是很好用的!!!
Statement of this Website
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

Hot Article

Hot tools Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Solution: Your organization requires you to change your PIN Solution: Your organization requires you to change your PIN Oct 04, 2023 pm 05:45 PM

Solution: Your organization requires you to change your PIN

How to adjust window border settings on Windows 11: Change color and size How to adjust window border settings on Windows 11: Change color and size Sep 22, 2023 am 11:37 AM

How to adjust window border settings on Windows 11: Change color and size

How to enable or disable taskbar thumbnail previews on Windows 11 How to enable or disable taskbar thumbnail previews on Windows 11 Sep 15, 2023 pm 03:57 PM

How to enable or disable taskbar thumbnail previews on Windows 11

How to change title bar color on Windows 11? How to change title bar color on Windows 11? Sep 14, 2023 pm 03:33 PM

How to change title bar color on Windows 11?

What file is index.html? What file is index.html? Feb 19, 2024 pm 01:36 PM

What file is index.html?

OOBELANGUAGE Error Problems in Windows 11/10 Repair OOBELANGUAGE Error Problems in Windows 11/10 Repair Jul 16, 2023 pm 03:29 PM

OOBELANGUAGE Error Problems in Windows 11/10 Repair

What are the differences between Huawei GT3 Pro and GT4? What are the differences between Huawei GT3 Pro and GT4? Dec 29, 2023 pm 02:27 PM

What are the differences between Huawei GT3 Pro and GT4?

Display scaling guide on Windows 11 Display scaling guide on Windows 11 Sep 19, 2023 pm 06:45 PM

Display scaling guide on Windows 11

See all articles