Set session variable if link is clicked, do not want to use GET
| From: | Kent | Date: | Tue, 05 Apr 2005 00:21:41 +0000 |
| Subject: | Set session variable if link is clicked, do not want to use GET | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-212230@lists.php.net to get a copy of this message | ||
Hi!
I am writing a simple shopping cart system which uses sessions and PHP.
I would like a normal link that says "Add to cart" which the user can click and the item is added to the cart.
However, i do not want to use GET for this as it could introduce unwanted features if the user bookmarks the page just after clicking "Add to cart". So i don't want an URL like: http://thisistheurl.com?buy=10 and therefore prefer if this could be done using POST.
It would have been easy if i would have used a normal FORM and would have had a button called "Add to cart". But i would like it to be in url-style or using some <img ..> which i understand that the BUTTON item does not support (or am i wrong?).
Any advice would be greatly appreciated.
Best regards, Kent