- 1php
- 2 //session_start();
- 3> 4 5 6 7arraywith a session 8 910
- Product Choice Page
- 11php
- 12 if(isset($_POST['form_products'])){
- 13 if(!empty($_SESSION['products'])){
- 14 $products=array_unique(
- 15 array_merge(unserialize($_SESSION['products']),$_POST['form_products']));
- 16 $_SESSION['products']=serialize($products);
- 17 }
- 18 else{
- 19 $_SESSION['products']=serialize($_POST['form_products']);
- 20 }
- 21 echo"
- your products have been registered!
- ";
- 22 }
- 23>24$_SERVER['PHP_SELF']; ?>">25 26for= "form_products">Select some products:
- 27 282930313233
- 34Submit Form3536
- go to content page
- 3738
来源: http://www.bubuko.com/infodetail-1968717.html