โค้ด: เลือกทั้งหมด
<?php require_once('control_db/connect.php'); ?>
<?php require_once('control_db/function.php'); ?>
<?php
if (!isset($_POST['submit'])) {
?>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" enctype="multipart/form-data">
<table width="743" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="images/newcarspage/images/selectbrand_head.png" alt="" width="743" height="32" /></td>
</tr>
<tr>
<td height="59" bgcolor="#f5f5f5"><table width="743" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="2" height="61"><img src="images/newcarspage/images/lefttopline.gif" alt="" width="2" height="61" /></td>
<td width="148" valign="bottom" class="radiobrand">
<input type="radio" name="brand" id="radio" value="alfaromeo" />
<label for="brand">Alfa Romeo</label></td>
<td width="148" class="radiobrand">
<input type="radio" name="brand" id="radio12" value="ferrari" />
<label for="brand">Ferrari</label></td>
<td width="148" class="radiobrand">
<input type="radio" name="brand" id="radio22" value="lamborghini" />
<label for="brand">Lamborghini</label></td>
<td width="148" class="radiobrand">
<input type="radio" name="brand" id="radio32" value="mitsuoka" />
<label for="brand">Mitsuoka</label></td>
<td class="radiobrand">
<input type="radio" name="brand" id="radio42" value="skoda" />
<label for="brand">Skoda</label></td>
<td width="2" align="right" valign="top"><img src="images/newcarspage/images/righttopline.gif" alt="" width="2" height="61" /></td>
</tr>
</table></td>
</tr>
<tr>
<td bgcolor="#f5f5f5"><table width="743" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="2"><img src="images/newcarspage/images/leftbottomline.gif" alt="" width="2" height="82" /></td>
<td><table width="650" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="99" height="46" align="right" bgcolor="#f5f5f5"><input name="submit" type="submit" class="go" value="GO" /> </td>
</tr>
</table></td>
<td width="2" align="right" valign="top"><img src="images/newcarspage/images/rightbottomline.gif" alt="" width="2" height="82" /></td>
</tr>
</table></td>
</tr>
<tr>
<td height="4" valign="top" bgcolor="#f5f5f5"><img src="images/newcarspage/images/bottomline.gif" alt="" width="743" height="4" /></td>
</tr>
</table>
</form>
<?php
}
else {
$linkName ="test/show.php?carid=".$_POST["brand"];
header("Location: /$linkName");
}
?>
โค้ด: เลือกทั้งหมด
<table class="content">
<?php
$carid = $_GET[brand];
if($carid=="")
alertgo("Please choose brand","test3.php");
$sql = "select * from model
inner join brand
on model.carid = brand.carid
where model.carid = '$carid'
and mactive = 1
and car_active = 1";
$get = "carid=$carid";
$result = mysql_query($sql);
$num = mysql_num_rows($result);
for ($i=1; $i<=$num; $i++){
$row = mysql_fetch_array($result);
?>
<td><form id="form1" name="form1" method="post" action="">
<table width="300" border="0" cellpadding="0" cellspacing="0" class="modeltext">
<tr>
<td align="center"><a href="pimage/large/<?php echo $row[mimage]?>" name="model"><img src="mimage/small/<?php echo $row[mimage]?>" border="0"/></a>
</td>
</tr>
<tr>
<td align="center"><?php echo $row[mname] ?></td>
</tr>
</table>
</form></td>
<?php if ($i%3 == 0 ) echo "</tr><tr>"; ?>
<?php } ?>
</table>