I have two dynamic drop down menus that contain two tables category and brand. I want to be able to select a value in each drop down menu and have the value passed through the url to select a specific item that corresponds to these two parameters. This is what I have for the page to be sent. It is not choosing the values, what am I doing wrong:
I have done this in dreamweaver as you can see
<body>
<div id="pagecell">
<div id="border">
<div id="head">Delete Product</div>
<div id="cleanercontent">
<p>Select the brand of the item you wish to delete. </p>
<form name="form1" id="form1" method="get" action="delete_citem.php">
<table width="100%" border="0">
<tr>
<td>Brands:</td>
<td><select name="brand_id">
<?php
do {
?>
<option value="<?php echo $row_brands['brand_id']?>"<?php if (!(strcmp($row_brands['brand_id'], $row_brands['brand_id']))) {echo "SELECTED";} ?>><?php echo $row_brands['brand_title']?> <?php echo $row_brands['brand_id']; ?> </option>
<?php
} while ($row_brands = mysql_fetch_assoc($brands));
$rows = mysql_num_rows($brands);
if($rows > 0) {
mysql_data_seek($brands, 0);
$row_brands = mysql_fetch_assoc($brands);
}
?>
</select>
</td>
</tr>
<tr>
<td>Category:</td>
<td> <select name="id">
<?php
do {
?>
<option value="<?php echo $row_category['id']?>"<?php if (!(strcmp($row_category['id'], $row_category['cat_id']))) {echo "SELECTED";} ?>><?php echo $row_category['cat_title']?></option>
<?php
} while ($row_category = mysql_fetch_assoc($category));
$rows = mysql_num_rows($category);
if($rows > 0) {
mysql_data_seek($category, 0);
$row_category = mysql_fetch_assoc($category);
}
?>
</select> </td>
</tr>
<tr>
<td> </td>
<td>
<a href="delete_citem.php?cat_id=<?php echo $row_category['id']; ?>&brand_id=<?php echo $row_brands['brand_id']; ?>">
select
</a></td>
</tr>
</table>
</form>
<p> </p>
</div>
</div>
</div>
</body>
</html>
<?php
mysql_free_result($brands);
mysql_free_result($category);
?>
I have done this in dreamweaver as you can see
<body>
<div id="pagecell">
<div id="border">
<div id="head">Delete Product</div>
<div id="cleanercontent">
<p>Select the brand of the item you wish to delete. </p>
<form name="form1" id="form1" method="get" action="delete_citem.php">
<table width="100%" border="0">
<tr>
<td>Brands:</td>
<td><select name="brand_id">
<?php
do {
?>
<option value="<?php echo $row_brands['brand_id']?>"<?php if (!(strcmp($row_brands['brand_id'], $row_brands['brand_id']))) {echo "SELECTED";} ?>><?php echo $row_brands['brand_title']?> <?php echo $row_brands['brand_id']; ?> </option>
<?php
} while ($row_brands = mysql_fetch_assoc($brands));
$rows = mysql_num_rows($brands);
if($rows > 0) {
mysql_data_seek($brands, 0);
$row_brands = mysql_fetch_assoc($brands);
}
?>
</select>
</td>
</tr>
<tr>
<td>Category:</td>
<td> <select name="id">
<?php
do {
?>
<option value="<?php echo $row_category['id']?>"<?php if (!(strcmp($row_category['id'], $row_category['cat_id']))) {echo "SELECTED";} ?>><?php echo $row_category['cat_title']?></option>
<?php
} while ($row_category = mysql_fetch_assoc($category));
$rows = mysql_num_rows($category);
if($rows > 0) {
mysql_data_seek($category, 0);
$row_category = mysql_fetch_assoc($category);
}
?>
</select> </td>
</tr>
<tr>
<td> </td>
<td>
<a href="delete_citem.php?cat_id=<?php echo $row_category['id']; ?>&brand_id=<?php echo $row_brands['brand_id']; ?>">
select
</a></td>
</tr>
</table>
</form>
<p> </p>
</div>
</div>
</div>
</body>
</html>
<?php
mysql_free_result($brands);
mysql_free_result($category);
?>