Ok, now I get back to the initial page, sort of. I end up at mmy.php when I'd like to be back at home.php but I'm not too concerned with this at this time. I'm not getting the data from query back to my second dropdown box. Not sure what I've done. The query does work, I can echo it back out in the php file, just can't get the transfer complete.
tpl:
Code:
{* $Id: mmy.tpl,v 1.0.0.0 2008/12/12 07:58:28 amm Exp $ *}
{capture name=menu}
<form method="post" action="mmy.php" name="mmysearchform">
<select name="year2" style="width: 80%;"onchange="javascript:document.mmysearchform.submit ();">
<option value="" selected="selected">Select Year</option>
<option value="2009">2009
<option value="2008">2008
<option value="2007">2007
<option value="2006">2006
<option value="2005">2005
<option value="2004">2004
</select><br>
<select name="make" style="width: 80%;"onchange="javascript:document.mmysearchform.submit ();">
<option value"" selected="selected">Select Make</option>
{foreach item=row from=$row}
<option value="{$row.makeid}">{$row.makename}</option>
{/foreach}
</select><br>
<select name="model" style="width: 80%;"onchange="javascript:document.mmysearchform.submit ();">
<option value="" selected="selected">Select Model</option>
</select>
</form>
<font class="CategoriesList"><a href="home.php?cat=" class="VertMenuItems"></a></font><br />
<font class="CategoriesList"><a href="home.php?cat=" class="VertMenuItems"></a></font><br />
{/capture}
{ include file="menu.tpl" dingbats="dingbats_categorie.gif" menu_title=$lng.lbl_mmy_search menu_content=$smarty.capture.menu cellpadding=$fc_cellpadding}
php:
Code:
<?php
require "./auth.php";
$year = $_POST['year2'];
///////////////////////////////////////////////// make query for dropdown
$query = sprintf("SELECT DISTINCT makeid, makename FROM iemmy WHERE yearid='$year'");
$result = @mysql_query($query);
$rowMake = mysql_fetch_array($result);
/////////////////////////////////////////////////
//do {
//echo $rowMake['makeid'];
//echo $rowMake['makename']."<br>";
//}while ($rowMake = mysql_fetch_array($result));
if (mysql_num_rows ($result) >= 1)
{
$makeid = array();
while ($rows = mysql_fetch_array ($result, MYSQL_ASSOC)) array_push ($makeid, $rows);
$smarty->assign("makeid", $makeid);
}
$smarty->assign("main", "iesearch");
$smarty->assign("location", $location);
func_display("customer/home.tpl",$smarty);
?>
Thanks again for the help.
Adam