On 11-02-13 02:25 PM, tedd wrote:
At 10:53 AM +0530 2/12/11, Ashim Kapoor wrote:
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.
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.
--
E-Mail Disclaimer: Information contained in this message and any
attached documents is considered confidential and legally protected.
This message is intended solely for the addressee(s). Disclosure,
copying, and distribution are prohibited unless authorized.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php