从a.php向b.php传递参数的控制有关问题

WBOY
Release: 2016-06-13 10:47:59
Original
1128 people have browsed it

从a.php向b.php传递参数的控制问题~
a.php里面有一个form表单,表单指向action="b.php",然后是通过post提交的。b.php里是接收这些表单里的数据(只有两个数据,都是字符串类型),然后向数据库里执行INSERT操作,然后通过header("Location:a.php")返回a.php页面。
问题就是:
我如何确保b.php只能通过a.php的表单提交来访问,而禁止其它一切访问方式?
比如检测表单的变量是否存在?

------解决方案--------------------
判断 $_SERVER['HTTP_REFERER'] 即可

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