Re: Problem retrieving $_POST values

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Nov 13, 2007 7:01 AM, chris smith <dmagick@xxxxxxxxx> wrote:

> On Nov 13, 2007 7:10 PM, Jon Westcot <jon@xxxxxxxxxxx> wrote:
> > Hi Chris:
> >
> > > Exactly as you have there.
> > >
> > > print_r($_POST);
> > >
> > > will show you everything.
> >
> >     Here's a section of what comes back when I do this:
> >
> >     [mls] => 1234567
> >     [property_address] => Main St
> >     [city_arr] => Array
> >         (
> >             [0] => CHNDHT
> >             [1] => CHNDLR
> >             [2] => GILBER
> >             [3] => HIGLEY
> >             [4] => MESA
> >             [5] => TEMPE
> >         )
>
> So it is there :)
>
> print_r($_POST['city_arr']);



You can use empty():

<?php
if (!empty ($_POST['city_arr'])) { ... }
?>

empty() will return false if the array is empty. http://www.php.net/empty


> > How are you creating the field in your form?
> >
> >     The three fields mentioned above on the form are specified thus:
>
> <snip>
> all looks good.
>
> > > > Is there some (free <g>) way to test a php script outside of a web
> page?
> > >
> > > cmd line you can do:
> > >
> > > php -l /path/to/file.php
> >
> >     Is this something I can access through SSH?  And will it show me
> errors as the script executes?
>
> Oops, I thought you meant for parse errors. That won't tell you about
> anything else unfortunately.


Are you running on Windoze? If so, I have seen that it will not throw parse
errors - it will just show a blank page. And believe me, this has caused me
a huge deal of frustration. If this is the case, you may consider using an
editor that has syntax validation built in.

HTH
~Philip

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux