HTML,PHP搜索框帮助

时间:2011-09-15 06:41:18

标签: php html

如何将搜索框定义为VIN,因此我的搜索字段中的值被发送到php代码$ VIN,然后从代码中检索它。

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Victorian Car Imports</title>
</head>

<body body bgcolor= "#000000"> 





<table  width="1359" height="1028" border="0" bgcolor="#000000" bg>

<tr>
<td width="111" height="120"><img src="Logo.png" width="111" height="120" /></td>
<td width="1238"><img src="banner.jpg" width="720" height="94"  align="middle"/></td>
</tr>


<tr>

<td height="780" valign="top"><a href="index.html">
<img src="Home.png" width="100" height="35" border="0"/></a> <br/> <p>
<a href="Cars.html"><img src="cars.png" border="0" width="100" height="35" /></a> <br/> 
  <p>
  <a href="FAQ.html"><img src="FAQ.png" border="0" width="100" height="35" /></a> <br/> <p> 
<a href="order_form.html"><img src="Order_form.png" width="100" height="35" border="0" /></a>  <p>
  <a href="Contact_us.html"><img src="Contact_us.png" width="100" height="35" border="0" /></a></td>

<td font color= "#FFFFFF" BODY TEXT="#FFFFFF" valign="top" ><font color="#FFFFFF" >

<form name="search" action="http://www.deakin.edu.au/~sjrem/ssss.php" method="post">
<h2> Search for a car of your choice </h2>   

<?php

$VIN = $_request ["search"]
?>

<p>
<table border="0">
<tr>
<td><input type="text" name="search" /> </td>
</tr>


</table> 



                       <p>
<input type="submit" name="action" value="search" />
</FORM>



<p>

1) This skyline R32 GTR has a low 22000K's on the clock. It has been taken car of very well. It is a 1992 model which consists of a immaculate interior and a manual gearbox. It comes equipped with Air Conditioner, Alloy Wheels, Power Steering, Power Windows and a stereo system. <p> $22000 Complied 
    <p>
<p><img src="R32_GTR_Front.jpeg" width="320" height="240" /><img src="R32_GTR_Rear.jpeg" width="320" height="240" />

<!-- Reference: http://www.tradecarview.com/used_car/japan%20car/nissan/skyline+gt-r/7898243/photo/?sid=300&pn=4 --> 
<!-- Reference: http://www.tradecarview.com/used_car/japan%20car/nissan/skyline+gt-r/7898243/photo/?sid=300&pn=0 -->

<p> 2) As new 2002 Nissan Silvia S15. 15000 Genuine K's with log books. This prestige car, come with Air Conditioner, Alloy Wheels, Power Steering, Power Windows, Turbo. This is a clean unmodified Silvia. Its one of a kind these days. It has been driven by our buyers in Japans, and the all clear has been given. So what are you waiting for? <p> $20000 including on road costs <p>

<img src="Silvia_front.jpeg" width="374" height="294" /><img src="Silvia_rear.jpeg" width="390" height="295" /> <p>

<!-- Reference: http://www.tradecarview.com/used_car/japan%20car/nissan/silvia/7896477/photo/?sid=300&pn=1 --> 
<!-- Reference: http://www.tradecarview.com/used_car/japan car/nissan/silvia/7896477/photo/?sid=300&pn=0 -->

 3) Brand New Nissan Skyline R35 GTR. This GTR is straight from the Nissan Factory in Japan. It is a 3.8 Ltr, Right hand drive, Gun metal grey in colour. It has a manual gearbox with 6 speed control. This performance car has 320kw at all four wheels and with that comes, traction control, abs brakes, driver, passenger and side air bags, power steering, and a alarm system. Contact us, if you would like any more information. $180000 Deliverd to your door step.
<p><img src="R35_front.jpg" width="384" height="284" /><img src="R35_rear.jpg" width="360" height="285" />
<p>

<!-- Reference: http://www.tradecarview.com/used_car/japan%20car/nissan/nissan+gt-r/7901460/photo/?sid=300&pn=2 --> 
<!-- Reference: http://www.tradecarview.com/used_car/japan%20car/nissan/nissan+gt-r/7901460/photo/?sid=300&pn=0 -->

 4) This 2005 Subaru Impreza arrived last week. It is one of our AWD turbo vechicles. It sports a powerful 180kw, and handles like a dream. The body is staight, and the paint is immaculate. It comes with 12 months rego, $17999
<p><img src="subaru_front.jpg" width="384" height="284" /><img src="subaru_rear.jpg" width="360" height="285" /> 
<p>

<!-- Reference: http://www.tradecarview.com/used_car/japan%20car/subaru/impreza/7904397/photo/?sid=300&pn=4 --> 
<!-- Reference: http://www.tradecarview.com/used_car/japan%20car/subaru/impreza/7904397/photo/?sid=300&pn=0  -->

 5) Mitsubishi Evolution 2006. This car is scheduled to arrive in Victoria in two weeks. It is All wheel drive sports car, sporting a 210 kw engine. It has all the safety features, such as airbags, traction control, ABS brakes, and power steering. This is a car which will never disappoint. $35000 including all on road costs. 
<p><img src="mitsubishi_front.jpeg" width="384" height="284" /><img src="mitsubishi_rear.jpeg" width="360" height="285" /> 
<p>

<!-- Reference: http://www.tradecarview.com/used_car/japan%20car/mitsubishi/lancer+evolution+ix+mr/7901029/photo/?sid=300&pn=2 --> 
<!-- Reference: http://www.tradecarview.com/used_car/japan%20car/mitsubishi/lancer+evolution+ix+mr/7901029/photo/?sid=300&pn=0 -->

 6) Toyota Chaser 1996. Boasting many electric features, Power windows, Power mirrors, Heated seats, and HID lights. This is a car, which looks like a normal family car, but has the grunt when the power is needed. We need this car moved fast, due to our next shipment coming in September. Priced to sell! $10 999
<p><img src="chaser_front.jpg" width="384" height="284" /><img src="chaser_rear.jpg" width="360" height="285" /> 
<p>

<!-- Reference: http://www.tradecarview.com/used_car/japan%20car/toyota/chaser/7846594/photo/?sid=300&pn=0 --> 
<!-- Reference: http://www.tradecarview.com/used_car/japan%20car/toyota/chaser/7846594/photo/?sid=300&pn=2 -->

</FONT>
</tr>

<tr>
<td width="111" height="120">row 2 cell 3</td>

<td width="1238"><FONT color="#FFFFFF" >©Deakin University, School of Information Technology. This web page has been developed as a student assignment for the unit SIT104: Introduction to Web Development. Therefore it is not part of the University's authorised web site. DO NOT USE THE INFORMATION CONTAINED ON THIS WEB PAGE IN ANY WAY."</FONT> 
</td>
</tr>

</table> 





</body>
</html>

1 个答案:

答案 0 :(得分:0)

首先是你的搜索框:

<input type="text" value="" name="vin" />

然后在你的PHP代码中:

$vin = mysql_real_escape_string($_POST['vin']);

//then do your query with $vin