1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<?php
session_start();
if (!isset($_SESSION['pseudo'])) {
header ('Location: index.php');
exit();
}
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body id="page1">
<div id="main">
<!-- header -->
<div id="header">
<div class="row_1">
<ul class="menu">
<li><a class="first current" href="membre.php">Accueil</a></li>
<li><a href="ou dormire membre.php">ou dormire</a></li>
<li><a href="ou manger membre.php">ou manger </a></li>
<li><a href="inscription.php">créer compte</a></li>
<li><a href="photis/index.php">galerie</a></li>
<li><a href="forume.php">forume</a></li>
<li><a class="last" href="index-6.php">favori</a></li>
</ul>
</div>
<div class="row_2">
<a href="index.php"><img alt="" src="images/logo.jpg" /></a>
</div>
</div>
Bienvenue<?php echo htmlentities(trim($_SESSION['pseudo'])); ?>!<br />
<a href="deconnexion.php">Déconnexion</a>
<a href="espacemembre.php">Accéder à votre compte</a>
<form action="ou dormire membre.php" method="post">
<span>Ville : </span>
<select name="ville"/>
<option value="alger">Alger</option>
<option value="oran">Oran</option>
<option value="annba">Annaba</option>
<option value="djanet">Djanet</option>
</select>
<p><label> Nom Hôtel : <input type="text" name="nom hotel"/></label><br/></p>
<p><input type="checkbox" name="case" id="case" /> <label for="case">Promotions</label>
</p>
<p><input type="checkbox" name="case" id="case" /> <label for="case">Piscine</label>
</p>
<input type="submit" name="recherche" value="Recherche">
</form>
<?php
$base = mysql_connect ('localhost', 'root', '');
mysql_select_db ('test', $base) ;
if (isset($_POST['ville']))
{
$sql = 'SELECT id, nom_hotel FROM hotels WHERE ville="'.$_POST[
'ville'].'"';
$req = mysql_query($sql) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
while ($data = mysql_fetch_array($req)){
echo '<tr>';
echo '<td>';
echo '<a href="afficher_details_hotel.php?id_hotel=' , $data['id'] , '">' , htmlentities(trim($data['nom_hotel'])) , '</a>';
echo '</td><td>';
}
}
else{
if ((isset($_POST['ville']))&&(isset($_POST['nom hotel'])))
{
$sql = 'SELECT id, nom_hotel FROM hotels WHERE ville="'.$_POST['ville'].'" AND nom_hotel="'.$_POST['nom hotel'].'"';
$req = mysql_query($sql) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
while ($data = mysql_fetch_array($req)){
echo '<tr>';
echo '<td>';
echo '<a href="afficher_details_hotel.php?id_hotel=' , $data['id'] , '">' , htmlentities(trim($data['nom_hotel'])) , '</a>';
echo '</td><td>';
}
}
}
?>
</body>
</html> |
Partager