Re: Submit Using An Image Form Processing

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

 



On Jun 18, 2011, at 7:34 PM, Shawn McKenzie wrote:

> On 06/18/2011 11:06 AM, Jason Pruim wrote:
>> 
>> On Jun 18, 2011, at 11:54 AM, "Ron Piggott" <ron.piggott@xxxxxxxxxxxxxxxxxx> wrote:
>> 
>>> <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" />
>> 
>> I would wrap the image in a link like so:
>> <a href="mypage.php?id={$autoincrementnum}"><img src="blah"></a>
>> 
>> And then have a get look for that variable:
>> 
>> $id=$_get[id];
>> 
>> If (isset($id)) {
>> 
>> //delete code here
>> }
>> 
>> Check all that before you run it.... I'm writing from my smart phone and it's all untested. Hopefully it gives you a start though. 
>> 
>> Jason Pruim 
> 
> Get method is for retrieval only.  It is not for anything that has a
> consequence (insert, update, delete, send email, etc.).  Use only post
> for those.

I've actually used $_GET in the way I described because then it doesn't require submitting a form to be able to delete something from a list.

with $_POST you would have to submit the form, so you would need to build an array of check boxes to store what ones you want to delete, and then go through and process the array to remove all the proper items.

But with the $_GET you can process it one at a time. I had a system up and working for maintaining a address database for quite awhile and it worked great for me.
-- 
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