le 01/05/2009 à 18:16
probleme formulaire de recherche
Voila enfin ça fonctionne
Merci a toi pour le petit coup de pouce.
je ne sais pas si c'est la meilleur façon de le faire mais au moins cela fonctionne très bien.
si il y a des critiques a faire je suis pret à les lire car je demande pas mieux d'apprendre.
voici le code
Encore merci de ton aide :)
Merci a toi pour le petit coup de pouce.
je ne sais pas si c'est la meilleur façon de le faire mais au moins cela fonctionne très bien.
si il y a des critiques a faire je suis pret à les lire car je demande pas mieux d'apprendre.
voici le code
<?php
if (isset($_POST['nom'])){
if (isset($_POST['commune'])){
if (isset($_POST['cp'])){
if (isset($_POST['type'])){
mysql_connect("localhost","root","mysql");
mysql_select_db ("belgitopia");
$avance_nom = $_POST['nom'];
$avance_commune = $_POST['commune'];
$avance_cp = $_POST['cp'];
$avance_type = $_POST['type'];
$avance_sql ="SELECT * FROM recherche WHERE nom LIKE '%$avance_nom%' AND commune LIKE '%$avance_commune%' AND cp LIKE '%$avance_cp%' AND type_activite LIKE '%$avance_type%'";
$avance_req=mysql_query($avance_sql) or die(mysql_error());
mysql_close();
while($avance=mysql_fetch_array($avance_req)){
?>
<hr id="recherche_haut_hr" style="color: #f7b309;">
<center><img src="<?php echo $avance['images']; ?>" width="500px"></img></center>
<table width="100%">
<tr><td valign="top" width="30%"><h2><?php echo $avance['type_activite']; ?></h2><td width="5%"></td><td valign="top" width="30%"><h2><?php echo $avance['nom']; ?></h2>
<td width="5%"></td><td width="30%"><?php echo $avance['lien_site']; ?></td></tr>
<tr><td valign="top" width="30%" style="border: dotted 1px #f7b309;"><?php echo $avance['descriptions']; ?></td><td width="5%"></td>
<td valign="top" width="30%"><?php echo $avance['tel']; ?><br/><?php echo $avance['fax']; ?><br/><?php echo $avance['horaires']; ?></td>
<td width="5%"></td><td valign="top" width="30%"><?php echo $avance['adresse']; ?><br/><?php echo $avance['cp']; ?><br/><?php echo $avance['commune']; ?><br/>
<?php echo $avance['mail']; ?><br/>
<?php //echo $avance['plan_acces'];?></td>
</tr>
</table>
<?php
}
}
}
}
}
?>
Encore merci de ton aide :)
