PHP 传值的有关问题

php中文网
发布: 2016-06-13 12:08:20
原创
961人浏览过

PHP 传值的问题

<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 />
登录后复制

<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 />
登录后复制


点击上面的 任何一个  在点击下面的 任何一个 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)这样,就会在地址栏中拼接上参数和值,还是很好用的!!!
PHP速学教程(入门到精通)
PHP速学教程(入门到精通)

PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!

下载
来源:php中文网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
开源免费商场系统广告
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号