Re: Submit Using An Image Form Processing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



At 11:54 AM -0400 6/18/11, Ron Piggott wrote:
I am writing a shopping cart using the PayPal API. Shopping cart works. Just adding additional functionality.
From the shopping cart contents I am trying to make it so the user may click on a picture of a trash can to delete the item. I wrote the following line of code:

<INPUT TYPE="image" SRC="http://www.theverseoftheday.info/store-images/trash_can.png"; WIDTH="20" HEIGHT="20" style="float: right;boarder: 0;" alt="Remove Product From Shopping Cart" name="remove_product" value="1" />

But when I have do:

echo $remove_product;

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.
OR

Is there a better way to pass a variable through a graphic? I am hoping for the shopping cart contents to be just 1 form where users will have several options (change quantities, delete specific items). I can't use a hidden field.
Thank you for your help.

Ron

Ron:

You don't need to pass a value. What you need is simply a trigger to do something. As such, you can use lot's of things.

In this case, a button should work.

http://www.htmlcodetutorial.com/forms/_BUTTON.html

However, I would take all the styling (including dimensions) out of it and place those in a css sheet.

Also, what's wrong with a hidden field?

Cheers,

tedd

--
-------
http://sperling.com/

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



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux