Re: $_POST and multiple windows
| From: | Jason Wong | Date: | Sat, 20 Nov 2004 13:46:56 +0000 |
| Subject: | Re: $_POST and multiple windows | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-202561@lists.php.net to get a copy of this message | ||
On Saturday 20 November 2004 21:02, Rory McKinley wrote:
> My question is about the $_POST superglobal. I assume that there will be
> only one instance of this superglobal per session and not per open
> window
You would in fact get a version of $_POST for *each* _request_. Request
meaning each time a form is submitted.
> (i.e. if I have three windows open, each running a different
> module within the same app independent of one another, there is only a
> single structure for storing their post data).
PHP has no notion of what your application consists of. When you submit a form
PHP has no idea whether it came from window1 or window2 or wherever.
> Hence, if I have fields
> in multiple windows that have a common name (e.g. I have two modules,
> each of which requires a field called client name) posts from different
> windows will overwrite the last post of a field with that common name,
> regardless which window it came from.
Even if you submit the same form twice in rapid succession nothing will get
overwritten. Each request (submission) starts a new instance of php with it
own copy of the form data.
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
What about WRITING it first and rationalizing it afterwords? :-)
-- Larry Wall in <8162@jpl-devvax.JPL.NASA.GOV>
*/