$_GET[]用法有关问题

WBOY
Release: 2016-06-13 13:52:32
Original
810 people have browsed it

$_GET[]用法问题
有这样一段PHP代码:食品 链接到example.php中,
如果$_GET[zhonglei]不用在example.php页面中,而是用在另外一个PHP文件(这个文件和example.php有联系)中可以吗?如果不行有什么方法可以引用??
我纠结一整天了!请高手赐教!!

------解决方案--------------------
ajax可以,异步GET传参
------解决方案--------------------
如果在example.php里include或require了另一个文件(如search.php),那么在search.php里是可以用$_GET['zhonglei']取到值的。
当然也可以在search.php里建立一个函数,然后在example.php里调用这个函数并传递参数。
------解决方案--------------------
嗯,把功能都分到不同的文件当中,然后include,自己写几行代码测一下就知道了
------解决方案--------------------
把值传到example.php文件后,所需值保存到session或cookie中就行

Related labels:
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!