Home > Backend Development > PHP Tutorial > 有关php页面传值的有关问题

有关php页面传值的有关问题

WBOY
Release: 2016-06-13 13:20:11
Original
818 people have browsed it

有关php页面传值的问题?
php除了GET POST都有哪种有效的多个页面间传值的方式啊,就是提交时把变量放的一个容器里,然后页面间可以访问这个变量,我用了session ,我是这样写的,A页面可以打印出$_SESSION["URL"]是abc,但在B页面访问不到这个SESSION值:
A页面这样写的:
session_start ();
$_SESSION["URL"]="abc";
echo $_SESSION["URL"];

B页面:
session_start ();
echo $_SESSION["URL"];

这样写法对不对啊?

------解决方案--------------------
代码是正确的
------解决方案--------------------
先生存SESSION 再使用SESSION

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