[thelist] post variable availability

Nan Harbison nan at nanharbison.com
Thu Feb 28 12:12:43 CST 2008


I think what I am doing wrong is - I have a form submit to itself, and then
it shows sign up options on a form and then you submit again, and then it
shows a credit card form, so I guess I am getting the form elements from
first form. 
So do I store the values that I keep needing as the process continues as
session variables? I always feel guilty when I do that, like it is the
cowards way out.

Thanks for your help!

-----Original Message-----
From: thelist-bounces at lists.evolt.org
[mailto:thelist-bounces at lists.evolt.org] On Behalf Of Phil Turmel
Sent: Thursday, February 28, 2008 1:04 PM
To: thelist at lists.evolt.org
Subject: Re: [thelist] post variable availability

Nan Harbison wrote:
> Hi All,
> This keeps coming back to bite me, I keep expecting that if I am using 
> an include or require file on a web page, the $_POST variables should 
> be available to that code as well as the actual page I am on, but this 
> is not true is it? So do I have to save the variable as a $_SESSION 
> variable or is there a better way?
> I hope I have made my question clear here.
> Thanks,
> Nan

Hi Nan,

In PHP, the $_POST, $_GET, $_SESSION and $_SERVER arrays are "superglobals"
[1], and are available in ALL included scripts, function scopes, and class

If you are trying to reference an expected item in one of these arrays, and
can't, there's something else wrong.



[1] http://www.php.net/manual/en/language.variables.predefined.php

Need to contact me offlist?
   Drop -webdev or you probably won't get through.

* * Please support the community that supports you.  * *

For unsubscribe and other options, including the Tip Harvester and archives
of thelist go to: http://lists.evolt.org Workers of the Web, evolt ! 

More information about the thelist mailing list