【学习笔记】session机制实现PHP购物车
使用到session的页面必须要有session启动函数session_start();清空系统中session可以用session_destroy();函数。
在php.ini文件中关于session的配置:session.save_path定义了存放session 的路径;session.name定义了sessionID的名称。
下面是练习的例子,列出代码。
index.html页面:
Content-Type: multipart/form-data; boundary=---------------------------314911788813839================================================================================-----------------------------314911788813839Content-Disposition: form-data; name="foo"bar-----------------------------314911788813839Content-Disposition: form-data; name="baz"The first line.The second line.-----------------------------314911788813839--you can see how the first one is useful for passing values UNCHECKED directly into an email program (e.g. if your form uses a mailto: address, so it uses your visitor's email program to send) but is largely useless for programmatic access to fields. only the bottom 2 examples are valid for actual form-based form data