farshadminaei
شنبه 12 مرداد 1392, 18:51 عصر
سلام
یه کدی واسه نمایش سرچ میخوام من الان کد جستجوش رو دارم ولی نمایش نمیده اگه میشه یکی اون کد رو بهم بده یا تایپیکی که مربوط میشه ادرسش رو بده دستتون درد نکنه .
یه کدی باشه که فقط نمایش بده نمیدونم این کدش مورد داره یا نه اگه مورد داره که خودتون یه اصلاح کنید خدایی فقط شدید و سریع لازم دارم
این کد من هست همه چیش ردیفه فقط مونده همون کد رو بزارم که نمایش بده .
<?php
define("DB","havapeyma");
define("DB_HOST","localhost");
define("DB_USER","root");
define("DB_PASSWORD","");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
body {
font-family: Georgia, "Times New Roman", Times, serif;
font-size: 65px;
font-weight: bold;
background: #033;
margin: 0px;
padding: 0px;
background-image: url(_images/page_background.jpg);
background-repeat: repeat-x;
}
#wrapper {
background: #FFF;
width: 800px;
margin-top: 0px;
margin-right: auto;
margin-left: auto;
font-size: 18%;
font-family: Tahoma, Geneva, sans-serif;
color: #000;
text-align: justify;
}
#header {
height: 100px;
background-color: #F06;
text-align: right;
}
#mainContent {
height: 500px;
background: #e1d8b9;
float: left;
width: 600px;
color: #03F;
}
#sidebar {
height: 500px;
float: right;
width: 200px;
border-top-color: #069;
border-right-color: #069;
border-bottom-color: #069;
border-left-color: #069;
background-color: #3CC;
font-family: Tahoma, Geneva, sans-serif;
font-size: 18px;
font-style: normal;
color: #303;
text-align: center;
text-decoration: none;
}
#footer {
color: #FFF;
background: #960;
height: 50px;
clear: both;
}
#wrapper #sidebar #form4 label {
font-size: 14px;
}
#wrapper #sidebar p label {
font-size: 12px;
}
#wrapper #sidebar #form5 label {
font-size: 12px;
}
#wrapper #sidebar #form5 p {
text-align: center;
}
#table {font:16px;}
#nav {background-color:red;
height:45px;
font:19px Tahoma, Geneva, sans-serif;
color:#FF0;
margin:0px auto 0px auto; }
#link1 {margin-left:0px;}
#link2 {margin-left:50px;}
</style>
</head>
<body>
<div id="wrapper">
<div id="header"><img src="_images/find_tag.png" width="243" height="90" alt="" /></div>
<div id="nav" align="center"> <A id="link2" href="main.html"> صفحه اصلی </A> <A id="link1"> </A> <A id="link1"> </A> <A id="link1"> </A> </div>
<div id="mainContent">
<table border="1" id="table" width="450px" align="center"> اسم هتل هایی شهرهایی استانبول و تایلند
<?php
if(isset($_POST['gh']) && isset($_POST['un']) && isset($_POST['tah'])){
$con = mysql_connect(DB_HOST,DB_USER,DB_PASSWORD) ;
mysql_select_db(DB);
$name = $_POST['na'];
$gh = $_POST['gh'];
$qu = mysql_query("SELECT * FROM toyrkhareji WHERE name LIKE '%$name%' OR price LIKE '$gh'",$con);
echo "<tr><td>نام تور</td><td>قیمت</td></tr>";
while($row = mysql_fetch_array($qu)){
echo "
<tr><td>{$row['contry']}</td>
<td>{$row['price']}</td></tr>
";
}
mysql_close($con);
}else
echo '
<tr>
<th> استانبول </th>
<th> تایلند </th>
</tr>
<tr>
<td><a href="hotel/star.html"> استار </a> </td>
<td> <a href="hotel/hilton.html"> هیلتون</a> </td>
</tr>
<tr>
<td><a href="hotel/lion.html"> لیون </a> </td>
<td> <a href="hotel/sherayton.html">شرایتون</a> </td>
</tr>
<tr>
<td><a href="hotel/sunroz.html">سان گیت </a> </td>
<td> <a href="hotel/ararat.html">آرارات </a></td>
</tr>
<tr>
<td><a href="hotel/fateh.html"> فاتح </a> </td>
<td> <a href="hotel/kervanseray.html">کاروانسرای </a></td>
</tr><tr>
<td><a href="hotel/sealife.html"> سی لایف </a> </td>
<td><a href="hotel/felamingo.html">فلامینگو </a></td>
</tr>
' ;
?>
</table>
</div>
<div id="sidebar">
<form id="form5" name="form5" method="post" action="<?php $_SERVER["PHP_SELF"] ?>">
<p>
<label for="نام 2">نام تور:</label>
<input type="text" name="na" id="نام 2" />
</p>
<p>
<label for="قیمت">قیمت از :</label>
<select name="gh" size="1" multiple="multiple" id="قیمت">
<option>200</option>
<option>300</option>
<option>400</option>
<option>500</option>
</select>
</p>
<label for="1تا">تا:</label>
<select name="gh" size="1" multiple="multiple" id="قیمت">
<option>600</option>
<option>700</option>
<option>800</option>
<option>900</option>
</select>
<p>
<label>نمایش
<input type="submit" name="نمایش1" id="نمایش1" value="Submit" />
</label>
</p>
</form>
</div> </div></body>
</html>
یه کدی واسه نمایش سرچ میخوام من الان کد جستجوش رو دارم ولی نمایش نمیده اگه میشه یکی اون کد رو بهم بده یا تایپیکی که مربوط میشه ادرسش رو بده دستتون درد نکنه .
یه کدی باشه که فقط نمایش بده نمیدونم این کدش مورد داره یا نه اگه مورد داره که خودتون یه اصلاح کنید خدایی فقط شدید و سریع لازم دارم
این کد من هست همه چیش ردیفه فقط مونده همون کد رو بزارم که نمایش بده .
<?php
define("DB","havapeyma");
define("DB_HOST","localhost");
define("DB_USER","root");
define("DB_PASSWORD","");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
body {
font-family: Georgia, "Times New Roman", Times, serif;
font-size: 65px;
font-weight: bold;
background: #033;
margin: 0px;
padding: 0px;
background-image: url(_images/page_background.jpg);
background-repeat: repeat-x;
}
#wrapper {
background: #FFF;
width: 800px;
margin-top: 0px;
margin-right: auto;
margin-left: auto;
font-size: 18%;
font-family: Tahoma, Geneva, sans-serif;
color: #000;
text-align: justify;
}
#header {
height: 100px;
background-color: #F06;
text-align: right;
}
#mainContent {
height: 500px;
background: #e1d8b9;
float: left;
width: 600px;
color: #03F;
}
#sidebar {
height: 500px;
float: right;
width: 200px;
border-top-color: #069;
border-right-color: #069;
border-bottom-color: #069;
border-left-color: #069;
background-color: #3CC;
font-family: Tahoma, Geneva, sans-serif;
font-size: 18px;
font-style: normal;
color: #303;
text-align: center;
text-decoration: none;
}
#footer {
color: #FFF;
background: #960;
height: 50px;
clear: both;
}
#wrapper #sidebar #form4 label {
font-size: 14px;
}
#wrapper #sidebar p label {
font-size: 12px;
}
#wrapper #sidebar #form5 label {
font-size: 12px;
}
#wrapper #sidebar #form5 p {
text-align: center;
}
#table {font:16px;}
#nav {background-color:red;
height:45px;
font:19px Tahoma, Geneva, sans-serif;
color:#FF0;
margin:0px auto 0px auto; }
#link1 {margin-left:0px;}
#link2 {margin-left:50px;}
</style>
</head>
<body>
<div id="wrapper">
<div id="header"><img src="_images/find_tag.png" width="243" height="90" alt="" /></div>
<div id="nav" align="center"> <A id="link2" href="main.html"> صفحه اصلی </A> <A id="link1"> </A> <A id="link1"> </A> <A id="link1"> </A> </div>
<div id="mainContent">
<table border="1" id="table" width="450px" align="center"> اسم هتل هایی شهرهایی استانبول و تایلند
<?php
if(isset($_POST['gh']) && isset($_POST['un']) && isset($_POST['tah'])){
$con = mysql_connect(DB_HOST,DB_USER,DB_PASSWORD) ;
mysql_select_db(DB);
$name = $_POST['na'];
$gh = $_POST['gh'];
$qu = mysql_query("SELECT * FROM toyrkhareji WHERE name LIKE '%$name%' OR price LIKE '$gh'",$con);
echo "<tr><td>نام تور</td><td>قیمت</td></tr>";
while($row = mysql_fetch_array($qu)){
echo "
<tr><td>{$row['contry']}</td>
<td>{$row['price']}</td></tr>
";
}
mysql_close($con);
}else
echo '
<tr>
<th> استانبول </th>
<th> تایلند </th>
</tr>
<tr>
<td><a href="hotel/star.html"> استار </a> </td>
<td> <a href="hotel/hilton.html"> هیلتون</a> </td>
</tr>
<tr>
<td><a href="hotel/lion.html"> لیون </a> </td>
<td> <a href="hotel/sherayton.html">شرایتون</a> </td>
</tr>
<tr>
<td><a href="hotel/sunroz.html">سان گیت </a> </td>
<td> <a href="hotel/ararat.html">آرارات </a></td>
</tr>
<tr>
<td><a href="hotel/fateh.html"> فاتح </a> </td>
<td> <a href="hotel/kervanseray.html">کاروانسرای </a></td>
</tr><tr>
<td><a href="hotel/sealife.html"> سی لایف </a> </td>
<td><a href="hotel/felamingo.html">فلامینگو </a></td>
</tr>
' ;
?>
</table>
</div>
<div id="sidebar">
<form id="form5" name="form5" method="post" action="<?php $_SERVER["PHP_SELF"] ?>">
<p>
<label for="نام 2">نام تور:</label>
<input type="text" name="na" id="نام 2" />
</p>
<p>
<label for="قیمت">قیمت از :</label>
<select name="gh" size="1" multiple="multiple" id="قیمت">
<option>200</option>
<option>300</option>
<option>400</option>
<option>500</option>
</select>
</p>
<label for="1تا">تا:</label>
<select name="gh" size="1" multiple="multiple" id="قیمت">
<option>600</option>
<option>700</option>
<option>800</option>
<option>900</option>
</select>
<p>
<label>نمایش
<input type="submit" name="نمایش1" id="نمایش1" value="Submit" />
</label>
</p>
</form>
</div> </div></body>
</html>