简单购物车
这篇教程会教你如何定一个简单的PHP购物车。 这个购物车会从普通的文件中读取商品,完全不用数据库。 使用者可以新增,移除商品,清除或更新购物车的商品价格。 程序是使用 session 来记录资料,不是用 cookie。 当然这个购物车是不可能用来当商业用途,它的功能只有加減和计算商品价格。
本教程的主旨是让你了解如何读取文件里的资料,如何使用 session 等等。 本教程主要用来:
普通文件的购物车
了解如何使用 session
了解如何读取文件
本教程不能:
教你如何写商业用途的购物车
教你 PHP 语法
教你如何使用数据库
首先建立一个商品目录文件,储存商品资料。
程式代码:
101:AA batteries (pack of 2):2.99 102:AA batteries (pack of 4):5.49 103:Backpack (black):69.99 [...]
You can make big savings by upgrading equipment on everything from mobile phones to games consoles
Extracted from: http://www.timesonline.co.uk/tol/money/consumer_affairs/article5946046.ece
Keeping up with technology can be something of a wild-goose chase as products become “out of date” within months of their launch. If you are willing to sacrifice pointless frills and street cred, however, and buy and upgrade [...]
Do you even notice that your attitude to spending will be changed very quickly?
My Swiss Watch was bought 3 year ago, and the battery was run out 2 weeks ago. At first, I just left my watch on the drawer by using the alternatives: laptop, mobile, and clock in the wall.
However, I should attend a [...]
The new rules announced on 22 February finally come to reality. Today the Home Office released a detail acknowledgement on it.
According to this news, the changes will come into effect for all applications submitted on or after 31 March 2009, while “anyone applying for an extension of their permission to stay under Tier 1 (General) [...]
Recent Comments