【学习札记】session机制实现PHP购物车

WBOY
Release: 2016-06-13 12:53:41
Original
896 people have browsed it

【学习笔记】session机制实现PHP购物车

使用到session的页面必须要有session启动函数session_start();清空系统中session可以用session_destroy();函数。

在php.ini文件中关于session的配置:session.save_path定义了存放session 的路径;session.name定义了sessionID的名称。

下面是练习的例子,列出代码。

index.html页面:

	
		<title>商品分类列表</title>
	
	
		<a href="a.php">运动器材</a><br>
		<a href="b.php">办公用品</a><br>
		<a href="c.php">烟酒副食</a><br>
		<a href="cart.php">查看购物车</a><br>
	
Copy after login

文件a.php页面代码:




<meta content="text/html; charset=GBK" http-equiv="Content-Type">
<title>璐</title>
Copy after login
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!