Bonjour voila mon probleme je voudrais savoir comment on fait lorsque une requete renvoie un champ vide sa m'envoie un mail et si sa renvoie un champ avec des données sa m'affiche le resultat.J'ai fait le script mais meme lorsque sa me renvoie aucune donnée sa m'affiche la meme page avec aucun resultat.
Voila mon script :
if (($rs == "")||($mailu == ""))
{
echo "
Veuillez saisir une Raison sociale/e-mail !
<p>";
}
else if(empty($resultat))
{
echo 'Aucun resultat cependant votre recherche a bien été pris en compte.Vous serez contacté dans les 48 heures.';
mail($mailme,'Une demande a été faite');
}
else {
echo "<center> <img src='carre.jpg'/> <font color='blue'> RESULTAT DE LA RECHERCHE</font></center>";
echo '<table border=0 cellpadding=25>';
echo '<tr><th>Reference</th><th>Descriptif</th><th>Ville</th><th>Debut</th><th>Duree</th><th>Date creation</th></tr>';
while ($ligne=mysql_fetch_array($resultat))
{
echo '<tr>
<td align="center"><a href="cobis.php?id='.$ligne['identifiant'].'">',$ligne['identifiant'],'</a></td>
<td align="center">',$ligne ['titreposte'],' , ',$ligne ['comp1'],' , ',$ligne ['comp2'],' , ',$ligne ['comp3'],'</td>
<td align="center">',$ligne ['villep'],'</td>
<td align="center">',$ligne ['datedebutvalidite'],'</td>
<td align="center">',$ligne ['dureevalidite'],'</td>
<td align="center">',$ligne ['datecreation'],'</td>
</tr>';
}
}
mysql_close();
?>
voila merci de bien vouloir m'aider !!
Partager