Gnarley drop-down db problem

From: Date: Wed, 11 Jun 2003 18:41:08 +0000
Subject: Gnarley drop-down db problem
Groups: php.db 
Request: Send a blank email to php-db+get-28551@lists.php.net to get a copy of this message
I have a user maintenance script. In the address maintenance page there is a drop down for the country entry. First, I retrieve the address info from a MySQL table. Globals are off, so I initialize the variables in the input with $country=$_GET['country']. In the country drop down I have <option value="USA" <?php if ($country == 'USA') { echo "selected"; } ?>>United States</option> and so forth for each country. This works beautifully, except that changes are not saved from this and sent to the database. I have, in the validation script (an included script), an initialization of the variables as $country = $_POST['country'] for later use since it makes for shorter coding later in the routines. Can anybody help with ideas about how I can capture the change to the drop down country entry? Or, why is the original value passed instead of the new one? I suspect my need to initialize with the $_GET, but I can't figure out how to both get the value from the query string and then send the changed value in the drop down. TIA, Paul

« previous php.db (#28551) next »