[Vtigercrm-developers] Why use _REQUEST when we have _POST or _GET?

Jorge Hoya jorge at jorgehoya.es
Mon Oct 8 02:03:16 PDT 2012


Hi all, I have a question:

If I want receive information from a html form, why I use _REQUEST variable
if I have the _POST one? This question comes from the using of _REQUEST
variable into vTiger's php code (for example:
customerportal/HelpDesk/SaveTicket.php; modules/Potentials/Save.php). 

PHP's official documentation talk's about this subject ( [1], [2]) and they
say that the _REQUEST information is not always the same, it depends on the
php.ini directives  "request_order" and "variables_order". If we use this
form:

<form name="frmProbe" action="?txtName=hello" method="post">
	<input type="text" name="txtName" value="bye" />
	<input type="submit" name="btnSend" value= "Send" />
</form>

What will be the value of "txtName" variable? If we change the value of
php.ini directive "variables_order" (or "request_order"), wich will be the
new value? What implicattions will this behaviour have on vtiger
installation? As we can't assure that php's configuration of every web
server will be the same, we must create web applications that work with
correct variables: 

If we expect information from a html form, we should use POST; if we expect
information from URL we should use GET.

This is my opinion, wich is yours?

[1] http://php.net/manual/en/reserved.variables.request.php
[2] http://www.php.net/manual/en/ini.core.php#ini.request-order
[3] http://devlog.info/2010/02/04/why-php-request-array-is-dangerous/
[4]
http://stackoverflow.com/questions/1419175/why-would-you-merge-get-and-post-
in-php



More information about the vtigercrm-developers mailing list