Basically this page selects the name of a product from a pull down box and sends the variables 'stock' and 'quantity' to the process.php form which in turn forwards and email automatcially.
I need this page to pull down other variables such as description, name and amountInStock when an item of stock is pulled down from the select box and forwarded to the process page. The process page selects data from the order page by:
$quantity = $_POST['quantity'];
$item = $_POST['stock'];
i need the other variables to be selected the same way.
Code:
<?php
session_start();
include("header.php");
echo "<form action='process.php' method='post'>";
echo "Select stock:<br>";
if(!isset($_GET['to']))
{
$query = "SELECT * FROM stock";
}
$con = makeConn();
$resultUsers = mysql_query($query);
if (mysql_num_rows($resultUsers) > 0){
echo "<select name='stock'>";
while ($row = mysql_fetch_array($resultUsers)){
echo "<option value='" . $row['stockID'] . "'>" . $row['name'] . "</option>\n";
}
echo "</select>";
}else{
echo msgError("Error: Your message was not sent.");
}
echo "Quantity: <input name='quantity' type='text' />";
echo "<input type='submit' />";
echo "</form>";
include("footer.php");
?>
|