Okay so I have created a function which brings up a column of information into a html drop down menu from a certain table. Now I want the data selected to be put into a value so it can be used in an upload form. This is the function. Thanks to LastMitch.
function namealbums()
{
$conn = mysql_connect("localhost", "root", "") or die ("could not connect to mysql");
mysql_select_db("photos") or die ("no database");
$query = "SELECT pic_id, album FROM albumname ORDER BY album";
$result = mysql_query ($query);
echo "<select name=dropdown value=''>Dropdown</option>";
while($r = mysql_fetch_array($result)){
echo "<option value=$r[pic_id]>$r[album]</option>";
}
echo "</select>";
}
?>
Now lets say someone selects an option from the drop down menu. I want that selection to have an id to be used in upload form. Here is the Html
<table width="300" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<form action="upload_file.php" method="post" enctype="multipart/form-data">
<td>
<table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">
<tr>
<label for="file" >Filename:</label>
</tr>
<tr>
<td width="78"></td>
<td width="6"></td>
<td width="294"><input id="infile" name="infile[]" type="file" onBlur="submit();" multiple></td>
</tr>
<tr>
</tr>
</table>
</td>
</table>
<table width="300" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<td width="78"></td>
<td width="6"></td>
<td width="294">
Select Album
</td>
<table width="300px" align="center" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">
<tr>
<td cellpadding="100">
<?php echo namealbums();?>
</td>
</tr>
<td> </td>
<td> </td>
<td><input type="submit" name="Submit" value="Upload"></td>
</form>
</table>
</table>
This form also uploads pictures which have been selected by the user.