1 to 3 done. 3 is maybe where I'm stuck. Here is the form code:
<form name="BPeCart_1_ATC_0" method="POST" action="<?php echo $_SERVER["PHP_SELF"]; ?><?php echo (isset($_SERVER["QUERY_STRING"]) && $_SERVER["QUERY_STRING"] != "")?"?".$_SERVER["QUERY_STRING"]:""; ?>">
<input type="text" name="BPeCart_1_Quantity_Add" value="1" size="4" >
<select name="BPeCart_1_Size_Add">
<?php
do {
?>
<option value="<?php echo $row_rsPPsize['ItemSizeName']?>"> <?php echo $row_rsPPsize['ItemSizeName']?> </option>
<?php
} while ($row_rsPPsize = mysql_fetch_assoc($rsPPsize));
$rows = mysql_num_rows($rsPPsize);
if($rows > 0) {
mysql_data_seek($rsPPsize, 0);
$row_rsPPsize = mysql_fetch_assoc($rsPPsize);
}
?>
</select>
<input type="hidden" name="BPeCart_1_ID_Add" value="<?php echo $row_rsPPselected["SizeID"]; ?>" />
<input type="hidden" name="BPeCart_1_Weight_Add" value="<?php echo $row_rsPPselected['ItemSizeWeight']; ?>" >
<input type="hidden" name="BPeCart_1_Price_Add" value="<?php echo $row_rsPPselected['ItemSizePrice']; ?>" >
<select name="BPeCart_1_Description_Add">
<?php
do {
?>
<option value="<?php echo $row_rsPPitems['ItemName']?>"><?php echo $row_rsPPitems['ItemName']?></option>
<?php
}
while ($row_rsPPitems = mysql_fetch_assoc($rsPPitems));
$rows = mysql_num_rows($rsPPitems);
if($rows > 0)
{
mysql_data_seek($rsPPitems, 0);
$row_rsPPitems = mysql_fetch_assoc($rsPPitems);
}
?>
</select>
<input type="image" src="WA_eCart/Images/Pacifica/Btn4_EN_addtocart.gif" border="0" value="Add to Cart" name="BPeCart_1_ATC">
<pre>
<?php if ($_POST)
{print_r($_POST);}?>
</pre>
</form>
***********************************
And here is the recordset for the selected:
$colname_rsPPselected = "-1";
if (isset($_POST['ItemSizeName'])) {
$colname_rsPPselected = (get_magic_quotes_gpc()) ? $_POST['ItemSizeName'] : addslashes($_POST['ItemSizeName']);
}
mysql_select_db($database_connBP, $connBP);
$query_rsPPselected = sprintf("SELECT SizeID, ItemSizeName, ItemSizePrice, ItemSizeWeight FROM itemsize WHERE ItemSizeName = %s", GetSQLValueString($colname_rsPPselected, "text"));
$rsPPselected = mysql_query($query_rsPPselected, $connBP) or die(mysql_error());
$row_rsPPselected = mysql_fetch_assoc($rsPPselected);
$totalRows_rsPPselected = mysql_num_rows($rsPPselected);
************************************
I don't seem to be getting a selection. My print_r has no value for the ID, weight and price even though the value for ItemSizeName is correct. Also if I test the recordset entering the value for ItemSizeName by hand it returns the correct row.