Voila le code complet:
<? $maxenreg = "4"; ?>
<? include "connb.php" ?>
<?
$rech= $HTTP_POST_VARS['rech'];
$critere= $HTTP_POST_VARS['critere'];
if($rech!="")
{if($critere=="societe")
{ $maquery=("select * from entreprise where nom like '%$rech%' And valide='oui' order by dateDerMaj ") or die("selection impossible");}
else if($critere=="dirigeant"){
$maquery= ("select * from entreprise where dirigeant like '%$rech%' And valide='oui' order by dateDerMaj" ) or die("selection impossible");} }
$query1 = "$maquery";
$result = $result = mysql_query($query1) or exit( '<b>ERREUR SQL</b><br />'.mysql_error().'<br />REQUETE : <br />'.$query1 );
$monnbr = mysql_num_rows($result);
if ($debut)
{
$nb = $debut + $maxenreg - 1;
$mondebut=$debut - 1;
$query2 = "$maquery LIMIT $mondebut,$nb";
$result2 = mysql_query($query2);
}
else
{
$nb=$maxenreg;
$query2 = "$maquery LIMIT 0,$nb";
$result2 = mysql_query($query2);
} ?>
<tr><td><a href="accueil.php">Business Center</font></a>>>Resultat de recherche</td></tr>
<?php
$result2 = mysql_query($query2) or exit( '<b>ERREUR SQL</b><br />'.mysql_error().'<br />REQUETE : <br />'.$query2 );
$nb = mysql_num_rows($result2);
$i=0;
if($nb!=0)
{ $echec="";
while (($i < $nb) &&($resultat=mysql_fetch_array($result2))){ ?>
<table>
<tr><td>
<a href="fiche.php?ident=<?php echo $resultat['nentreprise'] ; ?>"><? echo $resultat['nom'];
?> </a> </td>
<td><a href="fiche.php?ident=<?php echo $resultat["nentreprise"] ; ?>">Fiche</a> </td>
<td><a href="cartevisite.php?ident=<?php echo $resultat["nentreprise"] ; ?>">Carte visite</a> </td>
<?php if(!empty($resultat['pagevitrine']))
{ ?>
<td><a href="page_vitrine.php?ident=<?php echo $resultat["nentreprise"] ; ?>" target="_blank">page vitrine</a> </td> <? } ?>
<?php if(!empty($resultat['web']))
{ ?>
<td><a href="http://<?php echo $resultat["web"] ; ?>" target="_blank">Site web</a> </td> <? } ?>
</tr></table>
<table><tr>
<?php
$requete=mysql_query("SELECT DISTINCT logo, nentreprise FROM entreprise where valide='oui' ORDER BY RAND() LIMIT 6");
while($resultat=mysql_fetch_row($requete))
{
echo '<td><a href= fiche.php?ident=',$resultat[1],' ><img src="',$resultat[0],'" alt="" /></td>';
}
?>
</tr></table>
<p align="center"><?
$nbrpage1 = number_format($monnbr / $maxenreg);
$nbrpage = $nbrpage1 + 1;
for ( $i = 1; $i <= $nbrpage; $i++ )
{
$debut = ((($i - 1) * 4) + 1);
echo ("<a href=rechsimple.php?debut=$debut&page=$i>: <i>$i</i> :</a>");
}
?>
</p>
<?php }}
else
{$echec="Aucune entreprise correspondante à votre critère de recherche";
echo $echec;} ?>
<table>
<tr><td><?php $echec; ?></td></tr>
<tr><td><a href="accueil.php">Autre recherche</a></td><td><a href="rechavance.php">Recherche Avancée</a></td></tr>
</table>
<? mysql_close(); ?>
</body>
</html>
merci