jamesmva

Untitled

Sep 23rd, 2016
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.97 KB | None | 0 0
  1.  if(isset($_GET['plus'])){
  2.    $_SESSION['product_'.$_GET['plus']]+=1;
  3.    if($_SESSION['product_'.$_GET['plus']] < 1){
  4.    header('Location: checkout.php');
  5.    }else{
  6.    header('Location: checkout.php');
  7.     }
  8. }
  9.  
  10.  
  11.  if(isset($_GET['remove'])){
  12.    $_SESSION['product_'.$_GET['remove']]--;
  13.    if($_SESSION['product_'.$_GET['remove']] < 1){
  14.    header('Location: checkout.php');
  15.    }else{
  16.    header('Location: checkout.php');
  17.     }
  18.  
  19. }
  20.  
  21.  if(isset($_GET['delete'])){
  22.     $_SESSION['product_'.$_GET['delete']] = '0';
  23.     header('Location: checkout.php');
  24. }
  25.  
  26. $btn_add='<a class="btn btn-success" href="cart.php?plus='.$id.'"><i class="fa fa-plus fa-lg" aria-hidden="true" add_btn></i></a>';
  27.  
  28. $btn_remove = '<a class="btn btn-warning" href="cart.php?remove='.$id.'"><i class="fa fa-minus fa-lg" aria-hidden="true" remove_btn></i></a>';
  29.  
  30. $btn_delete='<a class="btn btn-default delete_btn" href="cart.php?delete='.$id.'"><i class="fa fa-times fa-lg" aria-hidden="true"></i></a>';
Advertisement
Add Comment
Please, Sign In to add comment