note 53990 added to tutorial.forms
| From: | php-general at lists dot php dot net | Date: | Mon, 20 Jun 2005 10:49:14 +0000 |
| Subject: | note 53990 added to tutorial.forms | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-90683@lists.php.net to get a copy of this message | ||
===
According to the HTTP specification, you should use the POST method when you're using the form
to change the state of something on the server end. For example, if a page has a form to allow users
to add their own comments, like this page here, the form should use POST. If you click
"Reload" or "Refresh" on a page that you reached through a POST, it's
almost always an error -- you shouldn't be posting the same comment twice -- which is why these
pages aren't bookmarked or cached.
You should use the GET method when your form is, well, getting something off the server and not
actually changing anything. For example, the form for a search engine should use GET, since
searching a Web site should not be changing anything that the client might care about, and
bookmarking or caching the results of a search-engine query is just as useful as bookmarking or
caching a static HTML page.
====
Indeed. It's not smart to say the least, to do database manipulation trough querystring
whatsoever.
----
Manual Page -- http://www.php.net/manual/en/tutorial.forms.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+53990
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+53990&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+53990&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+53990&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+53990&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+53990&report=yes&reason=non-english
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+53990&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+53990&report=yes
Search -- http://master.php.net/manage/user-notes.php