Alibabacloud.com offers a wide variety of articles about shopping cart in php source code, easily find your shopping cart in php source code information here online.
shopcar.php
Copy CodeThe code is as follows:
Class Shopcar
{
Product List
Public $productList =array ();
/**
*
* @param unknown_type $product in the product
* @return True there is no item in the cart
*/
Public Function checkproduct ($product)
{
for ($i =0; $i
ProductList), $i + +)
{
if ($this->productlist[$i] [' name ']== $product [' name '])
return $i;
}
return-1;
}
Add to
The code is as follows
Copy Code
if (! $session ! $scid) {$session = MD5 (Uniqid (rand ());Setcookie ("SCID", "$session", Time () + 14400);}/* Last number are expiration time in seconds, 14400 sec = 4 hrs * * Class Cart {function Check_item ($table, $session, $product) {$query = "SELECT * from $table WHERE session= ' $session ' and product= ' $pr
ShopCar. phpCopy codeThe Code is as follows:Class Shopcar{// Product listPublic $ productList = array ();/**** @ Param unknown_type $ the product to be imported* @ Return true no such item exists in the shopping cart*/Public function checkProduct ($ product){For ($ I = 0; $ I {If ($ this-> productList [$ I] ['name'] = $ product ['name'])Return $ I;}Return-1;}// Add to shopping cartPublic function add ($ pro
shopcar.php
Copy Code code as follows:
Class Shopcar
{
Product List
Public $productList =array ();
/**
*
* @param the goods that the Unknown_type $product to pass in
* @return True there is no such item in the Shopping cart
*/
Public Function checkproduct ($product)
{
for ($i =0; $i {
if ($this->productlist[$i] [' name ']== $product [' na
Using curl in php to forge the source IP address is a very good method. Next we will introduce an example of using php to forge the source IP address, however, the source of $ _ SERVER [REMOTE_ADDR] cannot be forged after testing. Using curl in
This kind of code can count the number of online users on your website. It is supported by php + txt without data. This kind of code can count the number of online users on your website. It is supported by php + txt without data.
Script ec (2); script
$ Time = gettimeofday (void );
// File initialization startIf (@ f
[PHP] Conditional compilation definition in PHP source code, php source code
The mechanism for Compiling different codes and generating different target files according to different si
First, the basic principle
Consider intercepting PHP to read the source file interface. At first, I considered processing from the interface between Apache and PHP, see Apache's src/modules/php4/mod_php4.c (this is the file that PHP compiles into the Apache,make install after the static method), Intercept the file poin
Universal DIY design software + online custom mall system source code-Open Source Chinese community 1. decompress the zip package to the website root directory (if there are other projects under this directory, create a folder and decompress it to the new folder );
2. access the root directory of the website and install it by following the steps (if the prompt
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.