php中怎么获取session

WBOY
Release: 2016-06-13 13:21:56
Original
1132 people have browsed it

php中如何获取session
在购物车中,session是什么意思,怎么来获取session的值,如何编写购物车程序,有谁知道,发给我一个,谢谢啦

------解决方案--------------------
首先session_start();
然后就可以直接设置session了
$_SESSION['val'] = 'value';
设置之后在其他页面就可以直接使用这个session
你去网上找找《PHP和MySQL Web开发》这本书上面有购物车的源码就是用session做的
------解决方案--------------------

session_start();
session_register("G_loginuser"); // 登陆id,可用于授权用户

获取 $G_loginuser='$$';

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