Well, I need some more help TFL,
This is what I need, I need to have the second drop down refresh depending on the users choice from the first one. This sounds like basic javascript, but I then need the second drop down to get it's options from a MySQL database.
Here's my code so far:
Code:
<!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=iso-8859-1" />
<title>test</title>
</head>
<body>
<?php if($_GET['page'] == NULL) { echo"
<div class=\"form\">
<p>Delete template</p>
<form id=\"form4\" name=\"form4\" method=\"post\" action=\"\">
<label>Category ";
$sql = "SHOW TABLES LIKE 'CMS_%'";
$query = mysql_query($sql);
$rows = array();
if(mysql_num_rows($query) > 0){
while($row = mysql_fetch_array($query)) {
array_push($rows, substr($row[0], 4));
}
}
if (count($rows) == 0) {
echo 'No tables in the database found beginning with <strong>cms_</strong>...<br />';
} else {
echo '<select name="deletetem1">';
if(is_array($rows)){
foreach($rows as $value){
echo '<option>'.$value.'</option>';
}
echo '</select>';
} else {
echo "$rows is not an array";
}
}
echo"
</label>
<p>
<select name="">
<!-- I need this drop down to get it's selections from the row "coolbeans" from the table selected above.-->
</select>
</p>
<p>
<label>
<input type=\"submit\" name=\"removecoolbeansub\" value=\"Delete\" />
</label>
</p>
</form>
</div>"; } ?>
</body>
</html>