[PHP] Re: detecting POST variables

2002-10-07 Thread Anup


This  is a snippet of what I use:

 foreach ($HTTP_POST_VARS  as $Index=>$Value) {
  echo "DEBUG ::: POST Key: $Index; POST Value: $Value\n";
 }

But I just want to know why sometimes when the form has empty values, that
sometimes it prints the key's name but not the actual value.
Assume the form has a textbox with name="FirstName", sometimes I get
DEBUG ::: POST Key: FirstName; POST Value:
OR
empty string
###
it looks like the first case has FirstName as a key in the POST array, where
as the latter doesn't.






<[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> You should use
> foreach($_POST as $key => $value) {
> echo $key.':'.$value;
> }
> Btw thats just an example to get all $_POST values, all superglobals are
> arrays.
>
> --
>
> Nicos - CHAILLAN Nicolas
> [EMAIL PROTECTED]
> www.WorldAKT.com - Hébergement de sites Internet
>
> "Anup" <[EMAIL PROTECTED]> a écrit dans le message de news:
> [EMAIL PROTECTED]
> > Hello, I have been dealing with different form proccessing PHP scripts.
> When
> > I start a new job I usually have a script that just takes the form POST
> > values and prints them to the screen, so I know what I'm working with.
> Now
> > I have a question say the form has 1 field named "FirstName". If the
field
> > is left blank, sometimes my script will print the key and NO value, or
it
> > will just print out nothing, ie NO key or value.
> >
> > any ideas.  Could it be the server (IIS or Unix/Linux) of the form and
the
> > server (IIS or Unix/Linux)  of the script.?
> > Since I do jobs for different people and environments any combination of
> > servers are possible.
> >
> > The reason, for this post is that I don't know if I should always put
code
> > to check for validilty using isset all the time or should I put it in
just
> > in case the script gets moved. I want to pinpoint this so that I can
write
> > more effective code.
> >
> >
> >
> >
>
>



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




[PHP] Re: detecting POST variables

2002-10-07 Thread nicos

You should use
foreach($_POST as $key => $value) {
echo $key.':'.$value;
}
Btw thats just an example to get all $_POST values, all superglobals are
arrays.

--

Nicos - CHAILLAN Nicolas
[EMAIL PROTECTED]
www.WorldAKT.com - Hébergement de sites Internet

"Anup" <[EMAIL PROTECTED]> a écrit dans le message de news:
[EMAIL PROTECTED]
> Hello, I have been dealing with different form proccessing PHP scripts.
When
> I start a new job I usually have a script that just takes the form POST
> values and prints them to the screen, so I know what I'm working with.
Now
> I have a question say the form has 1 field named "FirstName". If the field
> is left blank, sometimes my script will print the key and NO value, or it
> will just print out nothing, ie NO key or value.
>
> any ideas.  Could it be the server (IIS or Unix/Linux) of the form and the
> server (IIS or Unix/Linux)  of the script.?
> Since I do jobs for different people and environments any combination of
> servers are possible.
>
> The reason, for this post is that I don't know if I should always put code
> to check for validilty using isset all the time or should I put it in just
> in case the script gets moved. I want to pinpoint this so that I can write
> more effective code.
>
>
>
>



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