POST variables problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
debaser_68
Forum Newbie
Posts: 1
Joined: Sat Dec 07, 2002 1:43 pm
Location: Italy

POST variables problem

Post 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 !!
User avatar
hob_goblin
Forum Regular
Posts: 978
Joined: Sun Apr 28, 2002 9:53 pm
Contact:

Post 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>";
Post Reply