Re: [PHP] Accessing a form variable before the form is posted

2002-06-21 Thread Ma Siva Kumar

Thanks for the help

Duncan Hill wrote:

> Use different variable names.  Or make your function return a value, and
> use assignment to handle it.

Finally I made the function to take the select name as an optional variable 
and used different names for the two. This helped me in other situations 
also. Thanks a lot.

"johannes reichardt" wrote:

> If not you´d have big trouble ;)

Huge !!! I would have to add 7 more lines in my file :-). 

>
> 
>
> // this goes in the header
>
> 

Re: [PHP] Accessing a form variable before the form is posted

2002-06-21 Thread Duncan Hill

On Fri, 21 Jun 2002, Ma Siva Kumar wrote:

> In one of the forms, there is a selection for City in the address details
> as well as one for the port of destination. If I use the function both the
> the select name will be form[city_id]. The port of destination selection
> overwrites the form[city_id] from the selection of City.

Use different variable names.  Or make your function return a value, and use 
assignment to handle it.

> In short is it possible to access a variable from the form before the form
> is posted?

In short, no.

The flow is like this:

Browser requests page.
Webserver serves page, after parsing (if needed).
Browser displays page to user, and essentially disconnects from webserver.
User fills in form.  Server has no clue as of yet.
User presses submit.  Browser connects to server and sends data.  Server now 
knows about the data.

-- 

Sapere aude
My mind not only wanders, it sometimes leaves completely.
Never attribute to malice that which can be adequately explained by stupidity.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php