Re: using BOTH GET and POST in the same page.
| From: | tedd | Date: | Mon, 14 Feb 2011 17:31:13 +0000 |
| Subject: | Re: using BOTH GET and POST in the same page. | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-311280@lists.php.net to get a copy of this message | ||
At 10:31 PM -0500 2/13/11, Robert Cummings wrote:
On 11-02-13 02:25 PM, tedd wrote:Rob: Understood, but that is not what I am addressing. A form can only send data it has collected via it's declared method and the choices are POST or GET, but not both. Please review the post I made to Paul on this subject -- that explains this concept better. Cheers, tedd -- ------- http://sperling.com/At 10:53 AM +0530 2/12/11, Ashim Kapoor wrote:This is terribly wrong... any drupal site (or probably any front controller based CMS) will use GET variables to route to the correct page which may have a form which will capture the POSTed data. I've seen POST and GET often in the same page. Cheers, Rob.Dear All, I am reading "PHP5 and MySQL Bible". Chapter 7 of the book says that PHP can use GET and POST in the SAME page! Also it says that we can use the SAME variables in GET and POST variable sets and that conflict resolution is done by variable_order option in php.ini Can some one write a small program to illustrate the previous ideas? It is not clear to me as to how to implement this. Many thanks, Ashim.Ashim: What others have not addressed is that the form used to send variables will send only GET OR POST method variables, but not both at the same time. Using REQUEST will show the values of the variables sent, but will not show what method was used (not addressing COOKIE) and that is the reason why it's not the best idea to use REQUEST. Furthermore, as you point out, conflict resolution is done in accordance with variable order as set in the php.ini file and that can be different between different environments. As such, a script can act differently and there in lies the problem. Now, I have used scripts that may receive POST or GET variables and act accordingly, but you will never (except possibly AJAX) have a situation where a script will receive both sets of variables at the same time. So, I don't think one can write a small simple script that can demonstrate this.