Home  >  Article  >  Backend Development  >  Mini shopping basket 4 implemented by PHP4 Session_PHP tutorial

Mini shopping basket 4 implemented by PHP4 Session_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 17:28:51782browse

Fragment 3. Create a new basket and add an item to it
$#@60;?php
// Set the item count to 1
$ses_basket_items=1;
// Fill the 4th array 0 positions, using the value passed from the href link
// The link is as described in the 'Add a link to your page' section
$ses_basket_name[0]=$basket;
$ses_basket_amount[ 0]=1;
$ses_basket_price[0]=$price;
$ses_basket_id[0]=$id;
// Register a new basket in the session
session_register("ses_basket_items") ;
session_register("ses_basket_name");
session_register("ses_basket_amount");
session_register("ses_basket_price");
session_register("ses_basket_id");
?$#@62;
This will create a basket, fill all the values ​​in the 0th position of the array, and use session to register the array. A basket was born.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/531757.htmlTechArticleFragment 3. Create a new basket and add an item to it $#@60;?php // Set the item count to 1 $ses_basket_items=1; // Fill the 0th position of the 4 arrays using the href link passed in.. .
Statement:
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