Re: Problems passing data via GET and POST
| From: | Jason Stechschulte | Date: | Mon, 26 Mar 2001 21:40:23 +0000 |
| Subject: | Re: Problems passing data via GET and POST | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-45653@lists.php.net to get a copy of this message | ||
On Sat, Mar 24, 2001 at 05:05:59PM -0500, Matt Adams wrote:
> I recently wrote a (yet another) mailing portal which takes a certain
> action based on the contents of a hidden form field (i.e. if state==deliver
> then deliver mail to the recipient). Although I am certain the code
> could be better etc. etc. it works fine. I tested it on a Linux box
> running Apache-1.3.17 and PHP-4.0.4pl1 (as a module). However, when I
> transferred the project to another Linux server running Apache-1.3.12 and
> PHP-4.0.0 (also running as a module), the mailing portal refused to
> function properly. I discovered that the code that controls what action
> is taken was not picking up on the form contents passed to it.
>
> For a brief example, I have a file named "compose.php" which contains a
> form that passes a hidden field called "state" with the value "compose" to
> a file called "control.php" using the POST method. "control.php" is
> supposed to pick up on the "state" and sends the content of the
> "compose.php" form to the deliver stage. Unfortunately, it appears that
> "control.php" is not seeing any of the form data from "compose.php".
>
> My question is this: is there a setting in PHP (set either at compile or
> in the php.ini) that controls whether or not a PHP script will accept data
> passed to it via POST or GET?
I'm not sure but I think register_globals or something like that could
be the problem. I'm pretty sure that with this set, you don't have to
use the $HTTP_GET_VARS or $HTT_POST_VARS arrays. Without it set, you
are forced to use these arrays.
register_globals = on:
$HTTP_GET_VARS['testme']; // will have form info
$testme // will have form info
register_globals = off:
$HTTP_GET_VARS['testme'] // will have form info
$testme // will be empty
I could be completely wrong, but I think this is how that works.
--
Jason Stechschulte
jpstech@unoh.edu
--
The prayer of serenity applies here. To both of us. :-)
-- Larry Wall in <199710141802.LAA22443@wall.org>