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
| <?php
//$conn=new mysqli("localhost","root","admin","bd_intranet");
//$resultat=$_POST['recherche'];
include'fichier_connexion.php';
//$connect=mysql_connect("localhost", "root", "") or die ("Echec de la connexion au serveur !");
// s'il n'ya rien il ne fait rien
$recherche=$_POST['recherche'];
$query="select * from article where message_article like '%".$recherche."%' or titre_article like '%".$recherche."%' ";
$result=mysql_query($query);
$totenreg=mysql_num_rows($result);
echo"$query;";
$result=mysql_query($query);
echo "<table width=100% border=0 align=justify>";
echo "<tr bgcolor='#000000'>";
if ($totenreg==0)
{
echo "</tr>";
// echo "<tr align=center bgcolor=#5AACE4>";
echo "<td><span class='Style1'><div id='titre_texte_recherche'></div></span></td>";
echo "<td><strong>Titre de l'article</strong></td>";
// echo "<td><span class='Style1'><strong>PréNiveau</strong></span></td>";
// echo "</tr>";
$i=0;
while ($row=mysql_fetch_array($result))
{
if ($i==0)
{
echo "<tr bgcolor=#ffffff>";
$i++;
}
else
{
echo "<tr bgcolor=#FFFFFF>";
$i--;
}
echo "<tr>";
}
echo "</table>";
echo "<br><br>";
echo "<table width=50% align=justify>";
echo "<tr>";
echo "</tr>";
echo "</table> </div>";
echo "</form>";
}
else
{
{
echo "</tr>";
echo "<tr>";
echo "<td><span class='Style1'><div id='titre_texte_recherche'></div></span></td>";
echo "<td><span class='Style1'><div id='titre_texte_recherche'>Titre de l'article</div></span></td>";
//echo "<td><span class='Style1'><strong><div id='titre_texte'>Fichier</div></strong></span></td>";
echo "</tr>";
$i=0;
while ($row=mysql_fetch_array($result))
{
if ($i==0)
{
echo "<tr bgcolor=#FFFFFF>";
$i++;
}
else
{
echo "<tr bgcolor=#FFFFFF>";
$i--;
}
//echo "<td><h7>".$row["titre_article"]."</span></td>";
//echo '<td><img src="../Images/web.gif" width="16" height="16"></td>';
echo '<td><img src="../Images/web.gif" width="16" height="16"></td>';
echo '<td><h7><div id="texte_recherche"><a href="actualites12.php?idarticle='.$row['idarticle'].'">'.$row['titre_article'].'</div></span></td>';
echo "<tr>";
}
echo "</table>";
//echo "<br><br>";
echo "<table width=50% align=justify>";
echo "<tr>";
echo "</tr>";
echo "</table> </div>";
echo "</form>";
}
}
?> |