Dynamically modify the number of shopping cart page

jquery click event registration

 

Code Display

 

<?php

		session_start();
		
		$goods_id = $_GET['goods_id'];

		$choice = $_GET['choice'];

		// var_dump ($ _ GET);
		// the();
		// 1. Click the Add button is
		$arr = $_SESSION['gwc'];
		if($choice == 'jia'){
			// add the number 1,
			$arr[$goods_id]['num']+=1;
			
			
		the else {} // 2. Delete button is clicked, the front end does not limit the number to pass over 1

			$arr[$goods_id]['num']-=1;
			
		}
		// re-written into the session.
		$_SESSION['gwc'] = $arr;
		
       
		// var_dump ($ _ GET);
		// the();
        echo "OK";
		exit();
?>

  

Guess you like

Origin www.cnblogs.com/mzzone/p/11027044.html