I am creating a database that will be filled with items for sale. I am trying to create a back end so that the items can be edited, currently I am working on the pictures that will be uploaded for the items. I need to make it so that I can upload multiple pictures for each individual item. I have almost everything working however when I try to select the specific item from a page that lists all the items in the database I run into my problems. I have tried using select buttons but I am missing on passing only the one items id through to the next page and I wind up passing all of the ids along and get errors. Can anyone help? here is the code I am working with:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Vehicle Select</title>
</head>
<body onUnload="window.addEventListener("unload", invalidateBackCache, true)>
<center>
<?php
$result = mysql_query("SELECT * FROM inventory")
or die(mysql_error());
echo "<table border = '1'>";
echo "<tr><th>ID</th><th>Description</th></tr>";
while($row = mysql_fetch_array($result))
{
//print out the contents of each row
echo "<tr><td>";
echo $row['id'];
$refId = $row['id'];
echo "</td><td>";
echo $row['description'];
echo "</td><td>";
?>
<form action="picUploads.php" method="post"
enctype="multipart/form-data">
<input type="hidden" name="refID" value=<?php echo $refId; ?> /></td><td><input type="submit" name="submit" value="Select" />
<?php
echo "</td></tr>";
}
echo "</table>";
switch($refId)
{
}
?><br /><br />
<a href = addInventory.php><input type = "button" value = "Add Items" /></a> <a href = register.php><input type = "button" value = "Add Users" /></a><br /><br /><a href = logout.php><input type = "button" value = "Logout" /></a>
</center>
</body>
</html>
I need for the ID to be passed along to the next page to be used as a reference so that the pictures uploaded will refer to the selected item. The code for the page that it is passed to:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Photo Upload</title>
</head>
<body onUnload="window.addEventListener("unload", invalidateBackCache, true)>
<center><h1>UPLOAD PICTURES</h1></center>
<form action="upload.php" method="post"
enctype="multipart/form-data">
<input type="text" name="refID" value=<?php echo $_POST['check_option']; ?> /><br />
<label for="file">Filename:</label>
<input type="file" name="file" id="file" />
<input type="submit" name="submit" value="Submit" />
</form>
</body>
</html>
when I get this figured out there will be more places for the user to upload photos so that they can give more then one at a time. Thank you in advance for any help.