RE: [PHP] Passing POST VARS to funciton
| From: | Christensen, BruceX R | Date: | Fri, 11 Aug 2000 18:49:25 +0000 |
| Subject: | RE: [PHP] Passing POST VARS to funciton | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-11377@lists.php.net to get a copy of this message | ||
Also, make sure that you're actually using POST. If for some reason your
script was called using GET, you wouldn't see anything. I use this instead:
$cgi = getenv("REQUEST_METHOD") == 'GET' ? $GLOBALS[HTTP_GET_VARS] :
$GLOBALS[HTTP_POST_VARS];
This basically says that if the page was accessed using the GET method, set
$cgi to $HTTP_GET_VARS, otherwise set it to $HTTP_POST_VARS.
Then just use updateclient($cgi).
--Bruce
Bruce Christensen
Intel Corporation
brucex.r.christensen@intel.com
-----Original Message-----
From: O. [mailto:datahntr@yahoo.com]
Sent: Friday, August 11, 2000 9:51 AM
To: php-general@lists.php.net
Subject: Re: [PHP] Passing POST VARS to funciton
Chris wrote:
>
> Hi, I couldn't find this in the manual.
>
> How can I use all the incoming form values in my function without having
to pass every form value?
>
> I tried
> updateclient($HTTP_POST_VARS);
> but that does not work. and I really don't want to have to do this:
> updateclient($formvalue1,$formvalue2,$formvalue3, etc ..);
>
> Is there a way to delare all the HTTP_POST_VARS as global or something?
>
Insert this in your function.
global $HTTP_POST_VARS
Then access the post vars like so.
$HTTP_POST_VARS["formcontrolname"]
--
O.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net