Re: Avoid 'GET' method
- From: "Tony Marston" <tony@xxxxxxxxxxxxxxxxxx>
- Date: Tue, 19 Jul 2005 09:55:45 +0100
First, always use the POST method to update the database.
Second, do not put a separate set of buttons against each entry, use a
single set for the whole page. Put a checkbox against each entry so that the
user may select one or more entries, then when a button is pressed it
performs that action against those selected entries. Take a look at
http://www.tonymarston.co.uk/sample/person_list.php for an example.
This is part of my sample application
(http://www.tonymarston.net/php-mysql/sample-application.html) which you can
download to run locally.
--
Tony Marston
http://www.tonymarston.net
"Gordon Burditt" <gordonb.qy408@xxxxxxxxxxx> wrote in message
news:11dnud15psilqe5@xxxxxxxxxxxxxxxxxxxxx
>>> Is there a way to make a text link post
>>
>>no, you can't make a link *do* anything.
>
> Yes, you can, but it's debatable as to whether it's a good idea.
> For example, you might have a link labelled 'Delete' next to
> a listing for a user on the editusers.php page:
> http://my.domain.com/admin/editusers.php?mode=delete&userid=7362
> and clicking on it deletes the user in question. (Obviously some kind
> of authentication is in use for this, and maybe it takes you to a
> confirmation page).
>
> I'd be interested in someone's idea for a solution to the general
> problem: you have a table with possibly hundreds or thousands of
> lines in it. You want to have several clickable things on *each
> line* that do stuff to the item (say, a DNS record) in question
> (edit, delete, disable, enable, whatever). I've been using GET
> with links that have a mode variable and some kind of id variable.
> Disadvantages: running linkchecker on this destroys the database,
> given that it effectively clicks on every delete button.
>
> I've considered using PUT with forms with hidden fields instead.
> Disadvantages: (a) the submit buttons tend to be too darn big,
> making viewing enough of the table at one time impossible, and (b)
> browsers tend to run out of memory much faster with a thousand forms
> rather than a thousand links, and (c) a page with lots of forms is
> a lot longer in HTML than a page with lots of links, making load
> times noticible.
>
> Gordon L. Burditt
.
- Follow-Ups:
- Re: Avoid 'GET' method
- From: Gordon Burditt
- Re: Avoid 'GET' method
- From: Bob
- Re: Avoid 'GET' method
- References:
- Avoid 'GET' method
- From: el_roachmeister
- Re: Avoid 'GET' method
- From: John Dunlop
- Re: Avoid 'GET' method
- From: Gordon Burditt
- Avoid 'GET' method
- Prev by Date: Re: Beginner Question: Define PHP "framework" for me
- Next by Date: Re: >> Very Simple PHP DOM Question..Please help!
- Previous by thread: Re: Avoid 'GET' method
- Next by thread: Re: Avoid 'GET' method
- Index(es):