I posted another question:
My conveluted post
that I was so far off on a tangent, that I confused everyone answering.
I do not want to double post, and if a mod thinks I shoudl delete the first (I do) then I will.
Here is my issue.
I have a PHP form that has 3 items, in a dynamic table. I want to pass what items where selected and the quantities to my process.php page. I am trying to pass just the item ID and I can't seem to get even that working. Here is the code for the order.php page (which right now, I can only choose 1 item, then it deselects the previous items, I'll need to fix this later [also willing to take suggestions 🙂 ]:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>
<body>
<form action="process.php" method="post" name="SignOrder" id="SignOrder">
<?
$hostname = "localhost";
$database = "a";
$username = "robot";
$password = "c";
$path = "images/";
//$ID = $_POST['ID'];
$connpt = mysql_pconnect($hostname, $username, $password) or trigger_error(mysql_error(),E_USER_ERROR);
mysql_select_db($database, $connpt);
$result = mysql_query("SELECT * FROM dealeritems");
echo "<table>";
echo " <tr>".
" <td width=\"100\">".'ID'."</td>"."<td width=\"100\">".'Item Name'."</td>"."<td width=\"150\">".'Item Description'."</td>"."<td width=\"150\">".'Body Copy'."</td>"."<td width=\"100\">".'Image'.
" </tr>";
while ($row = mysql_fetch_assoc($result)) {
$ID = $row['ID'];
$ItemName = $row['ItemName'];
echo " <tr>".
" <td width=\"100\">".
$row['ID']."</td>".
"<td width=\"100\">".
$row['ItemName']."</td>".
"<td width=\"150\">".
$row['ItemDescription']."</td>".
"<td width=\"150\">".
$row['BodyCopy']."</td>".
" <td width=\"100\"><img src =$path".
$row['ImageName']." width=\"100\" height=\"125\"></td>".
"<td width=\"150\">".
"<input name=\"Order[]\" type=\"radio\" value=\"Ordered.$ID\">"."</td>".
"<td width=\"150\">".
"<select name=\"Quantity[]\" id=\"Quantity.$ID\">
<option value=\"0\">0</option>
<option value=\"1\">1</option>
<option value=\"2\">2</option>
<option value=\"3\">3</option>
<option value=\"4\">4</option>
<option value=\"5\">5</option></select>".
"</td>"." </tr>";
}
echo "</table>";
?>
<p> </p>
<p>
<input type="hidden" name="ID" value="<? echo $_POST['ID']; ?>">
<input type="submit" name="Submit" value="Submit">
<input type="reset" name="Reset" value="Reset">
<p>
</form>
<p> </p>
</body>
</html>
And on the process.php page I am just trying to display the ID (if I can get one working, then I believe I can get the rest working).
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>
<body>
<?
$ID = $_GET['ID'];
$_POST['ID'];
print $ID;
$max=100;
while($ID != 0) {
$quantity = $_GET['Quantity'];
$ordered = $_GET['Ordered'];
for($i=1;$i<$max;$i++) {
echo "Quantity: ".$i." Ordered: ".$ordered.$i;
echo $i;
}
}
echo " Thank you for your order. You will be contacted when the order is complete.";
?>
</body>
</html>
I admit that I am "grey" in this area. Someone suggest that I need a second form on the process page to pass the variable again, which I do not follow at all.
I really appreciate any help.
Thanks,
Don