Results 1 to 2 of 2

Thread: Please help me!!! Urgently!!!

  1. #1
    Join Date
    Jun 2005
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Please help me!!! Urgently!!!

    Hi to all, Can anyone that know what the following codes mean pls reply. Thanks a lot.<!-- Instantiate the Counter bean with an id of "counter" -->
    <jsp:useBean id="cart" scope="session" class="database.ShoppingCart" />
    <%
    String id = request.getParameter("itemID");
    String buttonPressed = request.getParameter("Submit");
    String updatePressed = request.getParameter("input");
    String quantity = request.getParameter("Sum");

    if(id!=null){
    if (updatePressed!=null){
    cart.updateQuantity(id, Integer.parseInt(quantity));
    }

    if (buttonPressed!=null){

    cart.removeItem(id);
    }
    }

    %>

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Check to see if either of two conditions is true, if one of them is, do one thing, if the other is, do something else. The details of these conditions and actions are defined elsewhere but, hinted at by the variable, string variable and function names involved. To wit, the updating of the quantity of or removal of an item from the shopping cart based upon wether or not a particular button has been pressed. In the case of the item quantity, it is also based upon (most likely) a user supplied value. Of course, if these names are inappropriate to their actual uses, it could be just about anything.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •