![]() |
Available news archives:
comp.lang.tcl
-
comp.lang.python
-
comp.security.firewalls
-
sci.crypt -
comp.lang.php -
comp.lang.javascript
|
|
comp.lang.php archiveRe: Avoid 'GET' method
From: Tony Marston <tony@NOSPAM.demon.co.uk>
Date: Tue Jul 19 2005 - 10:55:45 CEST
First, always use the POST method to update the database.
Second, do not put a separate set of buttons against each entry, use a
This is part of my sample application
-- Tony Marston http://www.tonymarston.net "Gordon Burditt" <gordonb.qy408@burditt.org> wrote in message news:11dnud15psilqe5@corp.supernews.com... >>> 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. BurdittReceived on Mon Oct 17 21:10:39 2005 |