On Saturday, June 18, 2011, Ron Piggott wrote:

> I am not getting anything.  Is there a correct way of passing a
> variable through an image?  The value in this above example is the
> auto_increment value of the product.  From this I could remove the
> item from the shopping cart.

An image causes two variables (name_x and name_y) to be set where
these give the coordinates of the point on the image where the user
clicked. So, the corresponding x and y $_GET or $_POST variables will
be set and using your example, if you had:

<form action='adjust_cart.php' method='post'>
<INPUT TYPE="image" 
SRC="http://www.theverseoftheday.info/store-images/trash_can.png";
  WIDTH="20"  HEIGHT="20" style="float: right;border:0;"
  alt="Remove Product From Shopping Cart" name="remove_product" />
</form>

Then in the called script, you could use:

if (isset($_POST['remove_product_x'])){
  // do stuff to remove product from cart
}

HTH,

-- 
Geoff


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to