I am trying to get the values posted from a form select. The select name is dynamic, meaning that the name value is defined by a database record.
In the form processing script, I want to call back that value via a $_REQUEST
.
I cannot know in advance what the value of the $_request
will be (eg, $var=$_REQUEST['foo'];
) but I do know that the value is one originitating from a database table.
Knowing this I create a database call, then use a foreach
to loop through the possible values.
I want to create a $_request
for each pass.
eg..
$prod_prop_name=mysql_query("SELECT * FROM `dshop_options_name`");
$prod_prop_name_array= array();
while($data9=mysql_fetch_array($prod_prop_name)) {
$prod_prop_name_array[]=$data9;
}
foreach($prod_prop_name_array as $rowNum => $data9){
$option_id=$data9[0];
$option_name=$data9[1];
echo"$option_name";
if($option_name==""){}
else{
$varnval=$_REQUEST[$option_name]; // this is my try at getting the var value
echo "$varnval"; // this is the output test
}
}
Problem I am having is that on the local server, I get a value, but on the webserver I get none. You can see I am using an echo
to see what happens. $varnval
Can anyone suggest a workaround for this issue?
Many Thanks
KF