Re: Problem retrieving $_POST values

From: Date: Tue, 13 Nov 2007 07:15:59 +0000
Subject: Re: Problem retrieving $_POST values
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-264425@lists.php.net to get a copy of this message
Jon Westcot wrote:
Hi all:
    I'm having problems retrieving an array value that should be in a $_POST setting.  In fact, I'm having trouble with the code hanging with no warnings or errors whatsoever, so I've got no clue why it's not working.
    Working code:
    if(isset($_POST["mls"])) {
        if(strlen(trim($_POST["mls"])) > 0) {
            $query = "mls=" . $_POST["mls"];
        }
    }
    Non-working code:
    if(isset($_POST['city_arr'])) {
        // This space intentionally left blank.
    }
    The only thing I know that is different is that "mls" is a single value and that city_arr is an array.  I have tried expressing it as "city_arr[]" with no success.
    Does anyone have an example of how to reference the $_POST value when said value is an array?  I can't seem to find a sample of this anywhere in the manual.
Exactly as you have there. print_r($_POST); will show you everything. How are you creating the field in your form?
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 -- Postgresql & php tutorials http://www.designmagick.com/

« previous php.general (#264425) next »