Problem retrieving $_POST values
| From: | Jon Westcot | Date: | Tue, 13 Nov 2007 06:56:44 +0000 |
| Subject: | Problem retrieving $_POST values | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-264424@lists.php.net to get a copy of this message | ||
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.
While I'm on the subject, how can I get a php page to tell me where a syntax error exists
if one does instead of just giving me a blank page? Is there some (free <g>) way to test a
php script outside of a web page?
Thanks!
Jon