Re: Delete
| From: | Larry Garfield | Date: | Sun, 04 Jun 2006 17:20:27 +0000 |
| Subject: | Re: Delete | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-237354@lists.php.net to get a copy of this message | ||
On Sunday 04 June 2006 03:11, Rabin Vincent wrote:
> On 6/4/06, Larry Garfield <larry@garfieldtech.com> wrote:
> > Make each button a separate form, with the id as a hidden value. Like
> > so:
> >
> > <div>
> > <form method='post'>
> > <p>My first entry</p>
> > <input type='hidden' name='id' value='1' />
> > <input type='submit' value='Delete' />
> > </form>
> > </div>
>
> [snip]
>
> You may find it easier to generate links of the form
> delete.php?id=1, etc. Then you won't have to use a seperate
> form for each link. The id will be available in delete.php
> in $_GET. The same sanity checking applies in this case too.
>
> Rabin
Only if delete.php is a confirmation page. Never ever ever have a delete
function that operates solely by GET.
Here's why: http://thedailywtf.com/forums/thread/66166.aspx
:-)
--
Larry Garfield AIM: LOLG42
larry@garfieldtech.com ICQ: 6817012
"If nature has made any one thing less susceptible than all others of
exclusive property, it is the action of the thinking power called an idea,
which an individual may exclusively possess as long as he keeps it to
himself; but the moment it is divulged, it forces itself into the possession
of every one, and the receiver cannot dispossess himself of it." -- Thomas
Jefferson