View Single Post
  #5  
Old 01-09-2009, 07:00 AM
 
AMMoyer AMMoyer is offline
 

Senior Member
  
Join Date: Nov 2008
Posts: 150
 

Default Re: Retaining selected Item in dropdown menu

Here is my php file I probably should have posted initially. I do post the variable as "yearid" and maybe that is my issue.

Code:
<?php require "./auth.php"; require $xcart_dir."/include/categories.php"; if ($active_modules["Bestsellers"]) include $xcart_dir."/modules/Bestsellers/bestsellers.php"; $query1 = sprintf("SELECT DISTINCT yearid FROM iemmy ORDER BY yearid DESC"); $result1 = @mysql_query($query1); while ($yearrow = mysql_fetch_assoc($result1)) { $yearid[] = $yearrow['yearid']; } $smarty->assign("yearid", $yearid); $year = $_POST['year']; if ($year){ $query2 = sprintf("SELECT DISTINCT makeid, makename FROM iemmy WHERE yearid='$year'"); $result2 = @mysql_query($query2); while ($makerow = mysql_fetch_assoc($result2)) { $makeid[] = $makerow['makeid']; $makename[] = $makerow['makename']; } } $smarty->assign("makeid", $makeid); $smarty->assign("makename", $makename); $make = $_POST['make']; if ($make){ $query3 = sprintf("SELECT DISTINCT modelid, modelname FROM iemmy WHERE makeid='$make' AND yearid='$year'"); $result3 = @mysql_query($query3); while ($modelrow = mysql_fetch_assoc($result3)) { $modelid[] = $modelrow['modelid']; $modelname[] = $modelrow['modelname']; } } $smarty->assign("modelid", $modelid); $smarty->assign("modelname", $modelname); $smarty->assign("main", "pages"); $smarty->assign("location", $location); func_display("customer/home.tpl",$smarty); ?>
__________________
Adam
X-Cart Gold 4.4.5 - Live
X-Cart Gold 4.1.11 - Retired
X-Payments 1.0.4
CDSEO Pro
EWD Hosting
Reply With Quote