Ajax запрос

Maxxis

Новичок
Всем привет !
PHP:
<form id="af"name="af">
<TABLE style="font-size:13px">
<TR><TD><select class="mark"name="mark" id="mark"  onchange="ChangeMake(this);" style="width:130px" >
<option label="" value="" >Марка</option>
<option label="AC" value="AC">AC</option>
<option label="Acura" value="Acura">Acura</option>
<option label="Alfa Romeo" value="Alfa Romeo">Alfa Romeo</option>
<option label="ARO" value="ARO">ARO</option>
<option label="Asia" value="Asia">Asia</option>
<option label="Audi" value="Audi">Audi</option>
<option label="Austin" value="Austin">Austin</option>
<option label="Avia" value="Avia">Avia</option>
<option label="Barkas" value="Barkas">Barkas</option>
<option label="BAW" value="BAW">BAW</option>
<option label="BMW" value="BMW">BMW</option>
<option label="Bugatti" value="Bugatti">Bugatti</option>
<option label="Buick" value="Buick">Buick</option>
<option label="BYD" value="BYD">BYD</option>
<option label="Cadillac" value="Cadillac">Cadillac</option>
<option label="Changan" value="Changan">Changan</option>
<option label="Chery" value="Chery">Chery</option>
<option label="Chevrolet" value="Chevrolet">Chevrolet</option>
<option label="Chrysler" value="Chrysler">Chrysler</option>
<option label="Citroen" value="Citroen">Citroen</option>
<option label="Dacia" value="Dacia">Dacia</option>
<option label="Dadi" value="Dadi">Dadi</option>
<option label="Daewoo" value="Daewoo">Daewoo</option>
<option label="DAF" value="DAF">DAF</option>
<option label="Daihatsu" value="Daihatsu">Daihatsu</option>
<option label="Dodge" value="Dodge">Dodge</option>
<option label="Dong Feng" value="Dong Feng">Dong Feng</option>
<option label="Eagle" value="Eagle">Eagle</option>
<option label="FAW" value="FAW">FAW</option>
</select><br>
<TD><select name="model" id="model" style="width:130px">
<option selected="selected" value="">Модель</option>
</select></td>
<td><input name="year" type="year" value="Год" style="width:51px;" maxlength="4"></td>
<td><input type="submit" value="поиск" class="button"></td></tr></table>
</form>
<a  href="nreview.html" rel="superbox[ajax][nreview.html]">Добавить отзыв</a>

<div id="total_reviews">
</div>
</body>
<script type="text/javascript">

	// загрузка сообщений из БД
	function show_reviews()
	{  var id  = $("#id").val();
		$.ajax({
			url: "review_show.php",
			data: "id="+id,
			success: function(html){
				$("#total_reviews").html(html);
			}
		});
	}
   $(document).ready(function()
	{
	    show_reviews();

		$("#af").submit(function(){
			var mark = $("#mark").val();
			var model  = $("#model").val();
			var year  = $("#year").val();
	    $.ajax({
				type: "GET",
				url: "review_show.php",
				data: "mark="+mark+"&model="+model+"&year="+year+"&act=add",
				success: function(){
					show_reviews();
			   }
			});

		});
     });

</script>
Функция show_reviews() выводит недавние отзывы.
$("#af").submit(function(){
должна искать отзывы по марке ,модели и по году ,но результата нет
в чем моя ошибка ,кто может -подскажите
Заранее спасибо !


Вот код обработчика
PHP:
if ($_REQUEST[act]=="add")
{
$build_query="";
if (isset($_REQUEST["mark"]) && !empty($_REQUEST["mark"])) $build_query .= " AND `mark` LIKE '".$_REQUEST["mark"]."'";
if (isset($_REQUEST["model"]) && !empty($_REQUEST["model"])) $build_query.= " AND `model`LIKE'".$_REQUEST["model"]."'";

	$c=0;
	$query=mysql_query("SELECT * FROM `auto`.`reviews` WHERE 1 ".$build_query."  ORDER BY `text` DESC LIMIT 0,10"); 
	while ($build_res=mysql_fetch_array($query)) 
	{

			?>



			<table border="0" cellspacing="3" cellpadding="0" width="500" style="margin: 10px 0px;">
			<tr>
			<td><?php echo $build_res['mark'];?>&nbsp;<?echo $build_res['model'];  ?>&nbsp;<?echo $build_res['year'];  ?>  </td>
			</tr>
			</table>
			    <?php echo $build_res['username']; ?>
				<div style="width:350px;border:solid 1px C4C4C4;position:relative;" width="100px" height="70px">
					<?php echo $build_res['text']; ?>
					<br>
				</div>

            <tr>

				<td><?php echo $build_res['date']; ?></td>
			</tr>
			</table>

			<?php
		$c++;
	}


if ($c==0) 
		echo "Пока что отзывов о данном автомобиле нет,вы можете стать превым !<br>";
		header("Location: reviews.php");
exit();
}

$query=mysql_query("SELECT * FROM `auto`.`reviews` WHERE 1 ORDER BY `text` DESC LIMIT 0,10"); // 
	while ($build_res=mysql_fetch_array($query))  // для каждой записи организуем вывод.
	{
?>
			<table border="0" cellspacing="3" cellpadding="0" width="500" style="margin: 10px 0px;">
			<tr>
			<td><?php echo $build_res['mark'];?>&nbsp;<?echo $build_res['model'];  ?>&nbsp;<?echo $build_res['year'];  ?>  </td>
			</tr>
			</table>
			    <?php echo $build_res['username']; ?>
				<div style="width:350px;border:solid 1px C4C4C4;position:relative;" width="100px" height="70px">
					<?php echo $build_res['text']; ?>
					<br>
				</div>

            <tr>

				<td><?php echo $build_res['date']; ?></td>
			</tr>
			</table>
<?
 }

?>
 
Сверху