<form action=
"search.php" method=
"post" style=
"margin:0px; padding:0px "><table width=
"154" border=
"0" cellspacing=
"0" cellpadding=
"0" align=
"center">
<?php
$db =
mysql_connect ("localhost",
"root",
"");
mysql_query ("set character_set_client='cp1251'");
mysql_query ("set character_set_results='cp1251'");
mysql_query ("set collation_connection='cp1251_general_ci'");
mysql_select_db("cars",
$db);
?>
<script src=
"JsHttpRequest.js"></script>
<form>
<input id=
"select1" type=
"hidden" />
<input id=
"select2" type=
"hidden" />
<input id=
"select3" type=
"hidden" />
<input id=
"select4" type=
"hidden" />
<input id=
"select5" type=
"hidden" />
<input id=
"select6" type=
"hidden" />
</form>
<script>
function doload
(value
){
var req=
new JsHttpRequest
();
req.onreadystatechange=
function(){
if(req.readyState==
4) document.getElementById
("result").innerHTML=req.responseText;
}
document.getElementById
("select1").value = value;
req.open
(null,
"select2.php",
true);
req.send
({brand:value
});
}
function doload1
(value
){
var req=
new JsHttpRequest
();
req.onreadystatechange=
function(){
if(req.readyState==
4) document.getElementById
("result1").innerHTML=req.responseText;
}
var select1 = document.getElementById
("select1").value;
document.getElementById
("select2").value = value;
req.open
(null,
"select3.php",
true);
req.send
({brand:select1, model:value
});
}
function doload2
(value
){
var req=
new JsHttpRequest
();
req.onreadystatechange=
function(){
if(req.readyState==
4) document.getElementById
("result2").innerHTML=req.responseText;
}
var select1 = document.getElementById
("select1").value;
var select2 = document.getElementById
("select2").value;
document.getElementById
("select3").value = value;
req.open
(null,
"select4.php",
true);
req.send
({brand:select1, model:select2, body:value
});
}
function doload3
(value
){
var req=
new JsHttpRequest
();
req.onreadystatechange=
function(){
if(req.readyState==
4) document.getElementById
("result3").innerHTML=req.responseText;
}
var select1 = document.getElementById
("select1").value;
var select2 = document.getElementById
("select2").value;
var select3 = document.getElementById
("select3").value;
document.getElementById
("select4").value = value;
req.open
(null,
"select5.php",
true);
req.send
({brand:select1, model:select2, body:select3, fuel:value
});
}
function doload4
(value
){
var req=
new JsHttpRequest
();
req.onreadystatechange=
function(){
if(req.readyState==
4) document.getElementById
("result4").innerHTML=req.responseText;
}
var select1 = document.getElementById
("select1").value;
var select2 = document.getElementById
("select2").value;
var select3 = document.getElementById
("select3").value;
var select4 = document.getElementById
("select4").value;
document.getElementById
("select5").value = value;
req.open
(null,
"select6.php",
true);
req.send
({brand:select1, model:select2, body:select3, fuel:select4, engine:value
});
}
function doload5
(value
){
var req=
new JsHttpRequest
();
req.onreadystatechange=
function(){
if(req.readyState==
4) document.getElementById
("result5").innerHTML=req.responseText;
}
var select1 = document.getElementById
("select1").value;
var select2 = document.getElementById
("select2").value;
var select3 = document.getElementById
("select3").value;
var select4 = document.getElementById
("select4").value;
var select5 = document.getElementById
("select5").value;
document.getElementById
("select6").value = value;
req.open
(null,
"select7.php",
true);
req.send
({brand:select1, model:select2, body:select3, fuel:select4, engine:select5, color:value
});
}
</script>
<select name=
"brand[]" id=
"brand" onchange=
"doload(this.value);" style=
"width:150px; height:18px; font-family:tahoma; font-size:11px; color:#757575 ">
<option value=
"no_action">--Выберите марку--</option>
<?php
$sql =
mysql_query ("SELECT DISTINCT brand FROM t1");
while ($new_brand =
mysql_fetch_array($sql))
echo '<option value='.
$new_brand['brand'].
'>'.
$new_brand['brand'].
'</option>';
?>
</select>
<br>
<div id=
"result">
<select name=
"model[]" id=
"model" style=
"width:150px; height:18px; font-family:tahoma; font-size:11px; color:#757575 ">
<option value=
"no_action">--Выберите модель--</option>
</select>
</div>
<div id=
"result1">
<select name=
"body[]" id=
"body" style=
"width:150px; height:18px; font-family:tahoma; font-size:11px; color:#757575 ">
<option value=
"no_action">--Выберите тип кузова--</option>
</select>
</div>
<div id=
"result2">
<select name=
"fuel[]" id=
"fuel" style=
"width:150px; height:18px; font-family:tahoma; font-size:11px; color:#757575 ">
<option value=
"no_action">--Выберите тип топлива--</option>
</select>
</div>
<div id=
"result3">
<select name=
"engine[]" id=
"engine" style=
"width:150px; height:18px; font-family:tahoma; font-size:11px; color:#757575 ">
<option value=
"no_action">--Выберите тип двигателя--</option>
</select>
</div>
<div id=
"result4">
<select name=
"color[]" id=
"color" style=
"width:150px; height:18px; font-family:tahoma; font-size:11px; color:#757575 ">
<option value=
"no_action">--Выберите цвет--</option>
</select>
</div>
<div id=
"result5">
<select name=
"price[]" id=
"price" style=
"width:150px; height:18px; font-family:tahoma; font-size:11px; color:#757575 ">
<option value=
"no_action">--Выберите цену--</option>
</select>
</div>
<br>
<tr align=
"center"><td align=
"center"><input type=
"submit" value=
"Найти"><?php
//$_POST=0;?></td></tr>
<tr height=
"10"></tr>
</table></form>