Jump to content

[SOLVED] Gaining access to Drop Down Menu Variable


morganaf

Recommended Posts

code is below, I am creating a drop down menu. I want to echo the value selected in the drop down menu in the php file that is executed afterwards.  when I echo frmcounty in the php file it returns .$value. which makes sense, but I can't figure out how to get access to the data in $value which is what I need I think.

 

Thanks in advance.

 

 

 

 

$sql = 'SELECT lottoName FROM `Lottos` ORDER BY `lottoName` '; 

$result = mysql_query($sql) or die("could not retrieve" .mysql_error());

echo '<select name="'.frmcounty.'" id="'.frmcounty.'"><option value="">Select one…</option>';

while($info = mysql_fetch_array($result,MYSQL_ASSOC))
{
foreach($info as $value)
{
echo '<option value=".$value.">'.$value.'</option>';

}

}



echo "</select>";
echo '<input type="submit" value = "Submit" />';

?>

</form>

</body>
</html>

 

<?php
echo "hey";

extract($_POST);
echo $value;

$link = mysql_pconnect("pdb2.awardspace.com", "albert123_lotto", "lotto")

or die("pconnectfailed!" .mysql_error());

    

mysql_select_db("albert123_lotto", $link)

or die("unable to select db" .mysql_error());



$queryUpdate = 'INSERT INTO store_'.$store_num.'_wind (lottoName) VALUES('.$value.')';
$queryUpdateResult = mysql_query($queryUpdate, $link);


?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.