note 66788 deleted from tutorial.forms by philip
| From: | philip@php.net | Date: | Thu, 14 Sep 2006 00:25:04 +0000 |
| Subject: | note 66788 deleted from tutorial.forms by philip | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-117136@lists.php.net to get a copy of this message | ||
Note Submitter: Joe
----
Just wanted to add a note:
For beginners, it is wise to use the "GET" method in forms because you can see what is
being sent between the server and the web browser.
For example, in the example above, if you change
<form action="action.php" method="post">
to <form action="action.php" method="get">
you would get something like...
http://www.myserver.com/action.php?name=A&age=B
in your web browser.
However, a good idea is to always change the "GET" to a "POST" because the user
of the browser cannot change the contents of the information being sent from the form to the
webserver.
In the example given above,
<form action="action.php" method="post">
Would just have,
http://www.myserver.com/action.php
As you can see, no information is visible to the user of the browser.
In other words, _GET and _POST, has a lot of advantage over one another. I personally use
"POST" in everything so that the user of the page cannot "spam" it by
continually sending information with GET.
Simply put, with "GET" the user can physically change the values that the server gets,
whereas with the "POST" method, the user will have a hard time changing the information
sent to the server.
For example, if you have a user login service, you definitely want to submit the form by a
"POST" so that if someone wants to "change" the account to something like admin,
then he would have a hard time doing so because he cannot directly change the information on the
browser URL line and then simply send it like that everytime.