Page 1 of 1

POST variables problem

Posted: Sat Dec 07, 2002 1:43 pm
by debaser_68
POST variables problem
I'm trying to retrieve a simple variable using the POST method but I've found a very strange behaviour.

Here's my code chunks

Page 1: a simple form with a select HTML tag
...
<select name="maketframe" size="1">
<option value="USA">USA-United States</option>
<option value="-All-">-All-</option></select>
...

Page 2: used to collect the variable

if (isset($HTTP_POST_VARS["marketframe"]))
{
$strCountryCode = $HTTP_POST_VARS["marketframe"];
}

I expected to find only the value assigned to the HTML attribute value, like this:
$strCountryCode = "USA"
but instead the value is the concatenation of both the value and the whole $HTTP_POST_VARS associative array content, like this:
$strCountryCode = "USAmaketframe=USA"

Any idea (I've also tried using $_POST but nothing changed) ??

OS Version: Windows 2000 Adv. Server SP3
Web Server: Apache 2.0.43
PHP Version: 4.3.0-dev (Oct 20 2002 16:11:45), API Filter, accessing MS SQL Server 7

Thanks !!

Posted: Sat Dec 07, 2002 2:08 pm
by hob_goblin
This is weird.

Try putting this right before the collection of the variable:

Code: Select all

echo "<pre>";
print_r($_POST);
echo "</pre>";