静态页面调用动态数据问题
我有一个页面是静态的 HTML 有些地方需要 掉用数据库的内容 我自己弄不好 各位大虾帮忙看下我的代码
jquery 不太会 希望有前辈能帮忙写写或者修改一下 我正好学习一下 谢谢了
html页面
<script type="text/javascript" src=" https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<script type="text/javascript">
<!--
var hotels_name=$('#hotels_name').val();
$.get('http://localhost/chinahotelsmap/control/a1.php?hotels_name='hotels_name'',function(data){
$('#s').after(data);
});
//-->
</script>
<body>
<table width="932" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><p class="STYLE1"><span class="STYLE4"><img src="../../pic1/chinahotelsmap.GIF" width="932" height="87" /><br />
</span><span class="text-bar">Beijing Hotel | Shanghai Hotel | Xian Hotel | Guilin Hotel | Guangzhou Hotel | Hangzhou Hotel | Kunming Hotel | Shenzhen Hotel | Sanya</span><br />
<span class="text"><img src="../../pic1/arrow_on.gif" width="5" height="9" /><img src="../../pic1/arrow_on.gif" width="5" height="9" /> <a href="#">Home</a> : <a href="#">Beijing Hotel</a> : </span><br />
<br />
<br />
<span class="text-h1" id="hotels_name" name="hotels_name">北京红房子酒店</span></p>
<p class="STYLE1"><span class="text"><img src="../../pic1/friendship-hotel-beijing-exterior-view.jpg" width="300" height="200" align="right" />Radisson SAS Hotel Beijing is located in the commercial and embassy district and adjacent to the China International Exhibition Center (CIEC). The Hotel is conveniently located only 20 minutes drive from the Beijing International Airport.</span></p>
<p class="text"><span class="text-bold">Address</span>: 6A East Beisanhuan Road, Beijing<br />
Telephone: 86-10-64663388<br />
Star rating:</p>
<p class="text"><span class="text-bold">Surrounding attractions</span>: China International Exhibition Center<br />
More pictures: room, meetingroom, chinese address</p>
<p class="text-bold"> Book This Hotel</p>
<p class="text"><span class="text-bold">Location</span><br />
18 km to Airport<br />
19 km to Railway station<br />
10 km to downtown</p>
<p class="text"><span class="text-bold">Accommodation</span><br />
Radisson SAS Hotel Beijing has 362 air-conditioned guest rooms and suites in a variety of room styles, such as Italian and Chinese. The Royal Club rooms are even more spacious and located on the top three floors, which offer additional luxuries catering to your needs including exclusive use of the Royal Club Lounge for breakfast, afternoon tea or pre dinner aperitifs.<br />
All rooms are equipped with satellite TV, direct dial telephone with voice mail, mini bar and internet access.<br />
<br />
<br />
</p>
<table width="932" border="0" cellpadding="0" cellspacing="1">
<tr id="s">
<td width="201" class="text-white"><span class="text">Room
type</span></td>
<td width="165" class="text-white"><span class="text">Rate
(per night)</span></td>
<td width="232" class="text-white"><span class="text">Reserve </span></td>
<td width="329" class="text-white"><span class="text">Validity</span></td>
</tr>
PHP页面
$hotels_name=@$_REQUEST['hotels_name'];
//echo $hotels_name;
$sql="select hotels_type_name,hotels_price from hotels join hotels_type on hotels.hotels_type_id=hotels_type.hotels_type_id where hotels_name='$hotels_name'";
$res=mysql_query($sql);
while($row=mysql_fetch_array($res,MYSQL_BOTH)){
$hotels_type_name = $row['hotels_type_name'];
$hotels_price = $row['hotels_price'];
echo('
<tr id="hotelsprice" name="hotelsprice">
<td id="hotels_type_name" name="hotels_type_name" bgcolor="#99CCFF" class="text">'.$hotels_type_name.'</td>
<td id="hotels_price" name="hotels_price" bgcolor="#99CCFF" class="text"><span class="text">'.$hotels_price.'RMB </span></td>
<td bgcolor="#99CCFF" class="text"><span class="text"><a href="../../submithotel/form.php?HotelName=***&RoomType=***&HotelTel=***"><img src="../../pic1/reserve-china-hotel.gif" alt="reserve hotel" width="70" height="18" border="0" /></a></span></td>
</tr>
');
}