Geoff Lane <> wrote:

>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"
>  WIDTH="20"  HEIGHT="20" style="float: right;border:0;"
>  alt="Remove Product From Shopping Cart" name="remove_product" />
>Then in the called script, you could use:
>if (isset($_POST['remove_product_x'])){
>  // do stuff to remove product from cart
>PHP General Mailing List (
>To unsubscribe, visit:

What browser did you test your original script on, because IE has "problems" 
with image buttons on forms. Better to use a regular submit button and style it.

Don't use links. They might work fine, but search engines follow them, and can 
cause pains with scripts that don't take them into consideration.

Ashley Sheridan
Sent from my Android phone with K-9 Mail. Please excuse my brevity.

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to