title: how to use popup and action together in href tag
body: <p>I want to open a cart modal (popup which includes the item you just clicked  i am trying like this    </p>
  
  <pre><code>    &lt;a class="btnLink"  data-rel="popup" data-transition="slidedown" href="?action=addToCart&amp;PROD_ID=&lt;?php echo $row["PROD_ID"]; ?&gt;#cart"&gt;Add to cart&lt;/a&gt;&lt;/in&gt;
  </code></pre>
  
  <p>this is the part i want to open in popup but only to able to perform popup but not able to perform action</p>
  
  <pre><code>&lt;div id="cart"&gt;
  &lt;?php
  // initializ shopping cart class
  include 'Cart.php';
  $cart = new Cart;
  include 'db_const.php';
  if(isset($_REQUEST['action']) &amp;&amp; !empty($_REQUEST['action'])){
      if($_REQUEST['action'] == 'addToCart' &amp;&amp; !empty($_REQUEST['PROD_ID'])){
          $productID = $_REQUEST['PROD_ID'];
          // get product details
          $stmt = "SELECT * FROM RETAIL_STORE_PROD WHERE PROD_ID = '$productID'";
            $result = db2_prepare($conn, $stmt);
            db2_execute($result);
          $row = db2_fetch_assoc($result);
  
          $itemData = array(
              'PROD_ID' =&gt; $row['PROD_ID'],
              'PROD_NM' =&gt; $row['PROD_NM'],
              'MRP' =&gt; $row['MRP'],
              'qty' =&gt; 1
          );
  
          $insertItem = $cart-&gt;insert($itemData);
          //$redirectLoc = $insertItem?'viewCart.php';
          //header("Location: ".$redirectLoc);
      }elseif($_REQUEST['action'] == 'updateCartItem' &amp;&amp; !empty($_REQUEST['PROD_ID'])){
          $itemData = array(
              'rowid' =&gt; $_REQUEST['PROD_ID'],
              'qty' =&gt; $_REQUEST['qty']
          );
          $updateItem = $cart-&gt;update($itemData);
          echo $updateItem?'ok':'err';die;
      }elseif($_REQUEST['action'] == 'removeCartItem' &amp;&amp; !empty($_REQUEST['PROD_ID'])){
          $deleteItem = $cart-&gt;remove($_REQUEST['PROD_ID']);
          header("Location: viewCart.php");
      }elseif($_REQUEST['action'] == 'placeOrder' &amp;&amp; $cart-&gt;total_items() &gt; 0 &amp;&amp; !empty($_SESSION['sessCustomerID'])){
          // insert order details into database
             // insert order items into database
             // $insertOrderItems = $db-&gt;multi_query($sql);
  
  
  
      }
  }
  
  
  ?&gt;
     &lt;title&gt;Shopping Cart&lt;/title&gt;
      &lt;meta charset="utf-8"&gt;
      &lt;link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css&lt;script&gt;
      function updateCartItem(obj,PROD_ID){
          $.get("cartAction.php", {action:"updateCartItem", PROD_ID:PROD_ID, qty:obj.value}, function(data){
              if(data == 'ok'){
                  location.reload();
              }else{
                  alert('Cart update failed, please try again.');
              }
          });
      }
      &lt;/script&gt;
  
      &lt;h1&gt;Shopping Cart&lt;/h1&gt;
      &lt;table border="0" class="table_fields"  id="t01" cellpadding="2px" cellspacing="20px" style="width:100%"&gt;
  
          &lt;tr class="table_fields_top"&gt;
              &lt;th&gt;Product&lt;/th&gt;
              &lt;th&gt;Price&lt;/th&gt;
              &lt;th&gt;Quantity&lt;/th&gt;
              &lt;th&gt;Subtotal&lt;/th&gt;
              &lt;th&gt;&amp;nbsp;&lt;/th&gt;
          &lt;/tr&gt;
  
      &lt;tbody&gt;
          &lt;?php
          if($cart-&gt;total_items() &gt; 0){
              //get cart items from session
              $cartItems = $cart-&gt;contents();
              foreach($cartItems as $item){
          ?&gt;
          &lt;tr class="table_fields_top"&gt;
              &lt;td&gt;&lt;?php echo $item["PROD_NM"]; ?&gt;&lt;/td&gt;
              &lt;td&gt;&lt;?php echo 'Rs'.$item["MRP"].' '; ?&gt;&lt;/td&gt;
  
              &lt;td&gt;&lt;input type="number" class="form-control text-center" value="&lt;?php echo $item["qty"]; ?&gt;" onchange="updateCartItem(this, '&lt;?php echo $item["rowid"]; ?&gt;')"&gt;&lt;/td&gt;
              &lt;td&gt;&lt;?php echo 'Rs'.$item["subtotal"].''; ?&gt;&lt;/td&gt;
              &lt;td&gt;
                  &lt;!--&lt;a href="cartAction.php?action=updateCartItem&amp;id=" class="btn btn-info"&gt;&lt;i class="glyphicon glyphicon-refresh"&gt;&lt;/i&gt;&lt;/a&gt;--&gt;
                  &lt;a href="cartAction.php?action=removeCartItem&amp;PROD_ID=&lt;?php echo $item["rowid"]; ?&gt;" class="btn btn-danger" onclick="return confirm('Are you sure?')"&gt;&lt;img border="0" alt="Delete_button.png" src="Delete_button.png" width="50" height="50"&gt;&lt;/a&gt;
              &lt;/td&gt;
          &lt;/tr&gt;
          &lt;?php } }else{ ?&gt;
          &lt;tr&gt;&lt;td colspan="5"&gt;&lt;p&gt;Your cart is empty.....&lt;/p&gt;&lt;/td&gt;
          &lt;?php } ?&gt;
      &lt;/tbody&gt;
      &lt;tfoot&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;a class="btn btn-primary" href="billing.php"&gt;&lt;i class="glyphicon glyphicon-menu-left"&gt;&lt;/i&gt; &lt;img src="images/button_continue-shopping.png"&gt;&lt;/a&gt;&lt;/td&gt;
              &lt;td colspan="2"&gt;&lt;/td&gt;
              &lt;?php if($cart-&gt;total_items() &gt; 0){ ?&gt;
              &lt;td class="text-center"&gt;&lt;strong&gt;Total: &lt;?php echo 'RS'.$cart-&gt;total().''; ?&gt;&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;&lt;a href="checkout.php"&gt;&lt;img src="images/button_checkout.png &lt;i class="glyphicon glyphicon-menu-right"&gt;&lt;/i&gt;&lt;img src="images/button_checkout.png"&gt;&lt;/a&gt;&lt;/td&gt;
              &lt;?php } ?&gt;
          &lt;/tr&gt;
      &lt;/tfoot&gt;
      &lt;/table&gt;
  </code></pre>