Warning: main(http://gregory.kokanosky.free.fr/include/haut.html) [function.main]: failed to open stream: Network is unreachable in /mnt/102/sda/4/e/gregory.kokanosky/phpinfo/searchsource.php3 on line 2
Warning: main() [function.include]: Failed opening 'http://gregory.kokanosky.free.fr/include/haut.html' for inclusion (include_path='/mnt/102/sda/4/e/gregory.kokanosky/include:.:/usr/php4/lib/php') in /mnt/102/sda/4/e/gregory.kokanosky/phpinfo/searchsource.php3 on line 2
<?
// ------------------------------------------------------------------------- //
// Un moteur de recherche en php //
// ------------------------------------------------------------------------- //
// Copyright (C) 2000 - Grégory KOKANOSKY //
// ------------------------------------------------------------------------- //
// Web: http://gregory.kokanosky.free.fr/ //
// Email: gregory.kokanosky@free.fr //
// ------------------------------------------------------------------------- //
// Ce programme est libre, vous pouvez le redistribuer et/ou le modifier //
// selon les termes de la Licence Publique Générale GNU publiée par la Free //
// Software Foundation (version 2 ou bien toute autre version ultérieure //
// choisie par vous). //
// //
// Ce programme est distribué car potentiellement utile, mais SANS AUCUNE //
// GARANTIE, ni explicite ni implicite, y compris les garanties de //
// commercialisation ou d'adaptation dans un but spécifique. Reportez-vous à //
// la Licence Publique Générale GNU pour plus de détails. //
// //
// Vous devez avoir reçu une copie de la Licence Publique Générale GNU en //
// même temps que ce programme ; si ce n'est pas le cas, écrivez à la Free //
// Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, //
// MA 02111-1307, États-Unis. //
// ------------------------------------------------------------------------- //
include("include/config.inc.php3"); //fichier de config
include ("http://gregory.kokanosky.free.fr/phpinfo/include/header.html"); //header html
include("include/form.php3"); //formulaire de recherche
if (!isset($debut)) $debut = 0;
if (!empty($recherche))
{
$recherche=strtolower($recherche); //on passe en minuscule
$mots = str_replace("+", " ", trim($recherche)); //on remplace les + par des espaces
$mots = str_replace("\"", " ", $mots); //idem pour \
$mots = str_replace(",", " ", $mots); //idem pour ,
$mots = str_replace(":", " ", $mots); //idem pour :
$recherche=rawurlencode($recherche); //on encode la recherche
$tab=explode(" " , $mots);
$nb=count($tab);
$sql="select * from search where 1 and mot_cles like \"%$tab[0]%\" ";
for($i=1 ; $i<$nb; $i++)
{
$sql.="$operateur mot_cles like \"%$tab[$i]%\" ";
}
$sql2=$sql; //requete permettant de connaitre le nombre de résultats
$sql.=" Limit $debut,$limit "; // requête limitante.
mysql_connect($host,$user, $passwd);
$result2 = mysql_db_query($db,$sql2);
$result = mysql_db_query($db,$sql);
if($result)
{
$nrows = mysql_num_rows($result2);
$flag = 1;
if(mysql_num_rows($result)==0) echo "<center><b>Pas de Résultat</b></center><br>";
else
{
include("include/header_tab.html");
while($row = mysql_fetch_array($result))
{
echo $row["id"]." | ".$row["titre"];
$url = $row["url"];
echo " | <a href=\"$url\">$url</a><br>";
echo "Description : ".$row["description"]."<br><br>";
}
include("include/footer_tab.html");
mysql_free_result($result);
/****************** Mise en place de la navigation. ************************************/
$nombre=ceil($nrows/$limit);
echo "<center>";
if($debut>0)
{
echo "<a href=search.php3?recherche=$recherche&operateur=$operateur&debut=".($debut-$limit)."><<</a> ";
}
if ($nombre>1)
{
for($i=1; $i<=$nombre; $i++)
{
echo "<a href=search.php3?recherche=$recherche&operateur=$operateur&debut=".(($i-1)*$limit).">".$i."</a> ";
}
}
if(($debut+$limit)<$nrows)
{
echo "<a href=search.php3?recherche=$recherche&operateur=$operateur&debut=".($debut+$limit).">>></a>";
}
echo "</CENTER>";
}
}
echo "La requete SQL execute est : $sql" ;
}
else
{
echo("<center><br><b>Entrer au moins un mot</b></center>");
}
include ("http://gregory.kokanosky.free.fr/phpinfo/include/footer.html");
?>
Warning: main(http://gregory.kokanosky.free.fr/include/bas.html) [function.main]: failed to open stream: Network is unreachable in /mnt/102/sda/4/e/gregory.kokanosky/phpinfo/searchsource.php3 on line 4
Warning: main() [function.include]: Failed opening 'http://gregory.kokanosky.free.fr/include/bas.html' for inclusion (include_path='/mnt/102/sda/4/e/gregory.kokanosky/include:.:/usr/php4/lib/php') in /mnt/102/sda/4/e/gregory.kokanosky/phpinfo/searchsource.php3 on line 4