Voci ma page infosite.php
Code
<?php
include("bdd_utilisable.php");
include("moteur_utilisable.php");
mysql_connect("$db_server", "$db_user_login", "$db_user_pass") or die("Connexion impossible");
mysql_select_db("$db_name");
$nom_annuaire = $PMA_infos['titre_site'];
// on crée la requete SQL
$id = htmlentities($_GET['id']);
$sql = "SELECT * FROM $T_sites WHERE id=$id";
function affichage_sites_aleatoire($chiffre)
{
$requete=mysql_query("select id from sites_annuaires");
$nombre=mysql_num_rows($requete);
//boucle pour afficher 7 sites
for ($i=0;$i<$chiffre;$i++)
{
$nb=rand(1,$nombre);
$aff=mysql_query("select titre, description, url, url_image from sites_annuaires where id=$nb")or die (mysql_error());
$verif=mysql_num_rows($aff);
if($verif!=0)
{
$res=mysql_fetch_assoc($aff);
echo "<td valign=top title=\"$res[titre] - $res[description]\">";
echo "<a href=\"$res[url]\" onClick=\"open_classement('$res[url]')\">";
echo "<img src=\"$res[url_image]\" alt=\"$res[titre] - $res[description]\" border=0 width=120px height=90px>";
echo "</a>";
echo"</td>";
}
else
{
$i=$i-1;
}
}
echo "</tr>";
echo"</table>";
}
// on envoie la requête
$req = mysql_query($sql) or die('Erreur SQL !<br>'.$sql.'<br>'.mysql_error());
$row = mysql_fetch_assoc($req);
//on cherchre la catégorie
$sql2 = "SELECT cat_name FROM $T_categories WHERE id=".$row['id_cat']."";
$req2 = mysql_query($sql2) or die('Erreur SQL !<br>'.$sql2.'<br>'.mysql_error());
$row2 = mysql_fetch_assoc($req2);
$categ = htmlspecialchars($row2['cat_name']);
?>
<?php
//préparation URLs
$site = $row['url'];
$site2 = eregi_replace("http://","",$site);
$site3 = eregi_replace("www.","",$site2);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Infos sur un site présent dans l'annuaire, catégorie <?php echo $categ; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="robots" content="index, follow">
<meta name="revisit-after" content="1 days">
<meta name="rating" content="General">
<meta name="distribution" content="Global">
<meta name="resource-type" content="document">
<meta http-equiv="expires" content="0">
<meta name="page-topic" content="Annuare">
<meta name="audience" content="Tout">
<meta http-equiv="content-language" content="fr" />
<meta http-equiv="content-style-type" content="text/css" />
<meta http-equiv="content-script-type" content="text/javascript" />
<script type="text/javascript" src="js_utilisable.js"></script>
<link type="text/css" href="utilisable.css" rel="stylesheet" />
<link href="ext.css" rel="stylesheet" type="text/css" />
<link rel="alternate" href="http://www.bloc-annuaire.fr/nouveaux.php?output=rss" type="application/rss+xml" title="Bloc-Annuaire">
<style type="text/css" media="screen"><!--
INPUT { color: #000; font-size: 11px; font-family: verdana, Arial, Helvetica, Geneva, Swiss, SunSans-Regular; background-color: #EEEEEE }
SELECT { color: #000; font-size: 11px; font-family: verdana, Arial, Helvetica, Geneva, Swiss, SunSans-Regular; background-color: #EEEEEE }
TEXTAREA { color: #000; font-size: 11px; font-family: verdana, Arial, Helvetica, Geneva, Swiss, SunSans-Regular; background-color: #EEEEEE }
.txterror { color: black; font-size: 11px; font-family: Verdana, Arial, Helvetica, Geneva, Swiss, SunSans-Regular }
.txtform { color: black; font-size: 12px; font-family: Verdana, Arial, Helvetica, Geneva, Swiss, SunSans-Regular }
--></style>
</head>
<body>
<div id="header"></div>
<div class="menu_h">
<div class="menu_h1"></div>
<div class="menu_h3"></div>
<div class="menu_h2">
<!-- **********************
Ici c'est le menu du haut du menu
************************** --><? include "menu_haut.php"; ?></div>
</div>
<div class="m">
<div class="mbg">
<div class="nomcat1"></div>
<div class="m2">
<?php
$mots = isset($_REQUEST['mots']) ? $_REQUEST['mots'] : '';
if (ereg ("(www\.)?[a-z0-9]{1,1}[._a-z0-9-]*[a-z0-9]{1,1}\.[a-z]{2,4}$", $mots, $regs)) {
$mots = eregi_replace("http://","",$mots);
$mots = eregi_replace("www.","",$mots);
$mots = eregi_replace("\.[a-z]{2,4}","",$mots);
$mots=trim($mots);
} else {
$mots=trim($mots);
}
if (empty($mots))
{
$value = "";
$erase = " onfocus=\"if (!erased_annuaire)this.value = ''; erased_annuaire = true;\"";
} else {
$value = stripslashes(htmlspecialchars($mots));
$erase = "";
}
$mots = isset($_REQUEST['mots']) ? $_REQUEST['mots'] : '';
if (ereg ("(www\.)?[a-z0-9]{1,1}[._a-z0-9-]*[a-z0-9]{1,1}\.[a-z]{2,4}$", $mots, $regs)) {
$mots = eregi_replace("http://","",$mots);
$mots = eregi_replace("www.","",$mots);
$mots = eregi_replace("\.[a-z]{2,4}","",$mots);
$mots=trim($mots);
} else {
$mots=trim($mots);
}
if (empty($mots))
{
$value = "";
$erase = " onfocus=\"if (!erased_annuaire)this.value = ''; erased_annuaire = true;\"";
}
else
{
$value = stripslashes(htmlspecialchars($mots));
$erase = "";
}
?>
<form id="recherche" action="recherche.php" method="post">
<div>
<center><input type="hidden" name="action" value="seek" /><input type="hidden" name="nb_results2show" value="10" /><input type="hidden" name="booleen" value="AND" /><input type="text" name="mots" size="18" maxlength="100" value="<?php echo $value; ?>"<?php echo $erase; ?> class="text_to_search_annuaire" /><br>
<br>
<input type="submit" value="Rechercher" class="submit" /></div>
</form></center>
</div>
<div class="m3"></div>
</div>
<div class="mbg">
<div class="nomcat2"></div>
</div>
<div class="mbg" align="center">
<div class="m2" align="center">
<table width="138" border="0" cellspacing="2" cellpadding="0">
<tr>
<td>
<div align="left">
<? include "list_cat.php"; ?></div>
</td>
</tr>
</table>
</div>
</div>
<div class="mbg">
<div class="m3"></div>
</div>
<div class="mbg">
<div class="nomcat3"></div>
<div class="m2">
<center>
<table width="138" border="0" cellspacing="2" cellpadding="0">
<tr>
<td>
<div align="left">
<? include "offre_previlege.php"; ?></div>
</td>
</tr>
</table>
<br>
<a href="previlege/index.php">
Offre prévilège
</a><br>
<br>
<a title="Flux rss de Bloc-annuaire.fr" href="http://www.bloc-annuaire.fr/nouveaux.php?output=rss" target="_blank"><img src="images/rss.gif" alt="" height="14" width="24" border="0"></a></center>
</div>
<div class="m3"></div>
</div>
</div>
<div id="centre">
<div class="c">
<div class="c1"></div>
<div class="c3"></div>
<div class="c2">
<b>fiche détaillée du site : </b><font color="green"><b><?php echo $row['titre']; ?></b></font></div>
</div>
<div class="text_centre">
<p></p>
<table style="width:95%;margin:0;">
<!-- CENTRE -->
<tr>
<td style="width:100%;" valign="top" class="arbo_annuaire">
<div align="left">
<p><img src="images/arrow.jpg" alt="" height="12" width="18" border="0"><em><strong>Titre du site </strong></em>: <?php echo $row['titre']; ?><br>
<img src="images/arrow.jpg" alt="" height="12" width="18" border="0"><em><strong>URL</strong></em> : <a href="<?php echo $row['url']; ?>"><?php echo $row['url']; ?></a><br>
<img src="images/arrow.jpg" alt="" height="12" width="18" border="0"><b>Site référencé depuis le :</b> <?php echo $row['date_validation']; ?><br>
<img src="images/arrow.jpg" alt="" height="12" width="18" border="0"><em><strong>Dans la catégorie </strong></em>: <a href="<?php echo $row['id_cat'].'-'.$categ; ?>.html" title="<?php echo $categ; ?>"><?php echo $categ; ?></a><br>
<img src="images/arrow.jpg" alt="" height="12" width="18" border="0"><b>Lien cassé : </b><span class="categoriesite"><a href="mailto:romain3505@hotmail.com?subject=[Bloc-Annuaire] Probleme avec <?php echo $row['url']; ?>&body=Probleme avec <?php echo $row['url']; ?> dans la catégorie <?php echo $categ; ?> [lien casse,propos illicite ...] : ">Signaler le probleme</a></span></p>
<p><img src="images/arrow.jpg" alt="" height="12" width="18" border="0"><strong>Description</strong>:<br>
<br>
<span class="description_site_annuaire"><b><?php echo $row['description']; ?></b><br></p>
<p></p>
</div>
<div align="center">
<p><b><strong>Image </strong>du site:</b><br>
<br>
<a href="<?php echo $row['url']; ?>" target="_blank"><img src="<?php echo $row['url_image']; ?>" width="120" height="90" border="0" alt="<?php echo $row['titre']; ?>"></a></p>
</div>
<center></center>
<div align="left">
</p>
<p></p>
<p><em><strong>Référencement et popularité </strong></em>:</p>
<ul>
<li><em><strong>Google</strong></em> : <strong><?php echo $blG; ?></strong> > <a href="http://www.google.fr/search?hl=fr&q=link%3A<?php echo $site; ?>&btnG=Recherche+Google&meta=" target="_blank">Pages liées</a> | <a href="http://www.google.fr/search?hl=fr&newwindow=1&q=info%3A<?php echo $site; ?>&meta=" target="_blank">Infos Google</a> | <a href="http://www.google.com/search?sourceid=navclient&q=cache:<?php echo $site; ?>" target="_blank">Cache Google</a> | <a href="http://www.google.com/search?hl=fr&newwindow=1&q=site%3A<?php echo $site; ?>&meta=" target="_blank">Pages indexées</a>
<li><em><strong>MSN</strong></em> : <strong><?php echo $blM; ?></strong> > <a href="http://search.msn.fr/results.aspx?q=link%3A<?php echo $site; ?>&FORM=QBHL" target="_blank">Pages liées</a> | <a href="http://search.msn.fr/results.aspx?q=site%3A<?php echo $site; ?>&FORM=QBRE" target="_blank">Pages indexées</a>
<li><em><strong>Yahoo</strong></em> : <strong><?php echo $blY; ?></strong> > <a href="http://search.yahoo.com/search?p=link%3Ahttp%3A%2F%2F<?php echo $site2; ?>&ei=UTF-8&fr=sfp&n=20&fl=0&x=wrt" target="_blank">Pages liées</a> | <a href="http://search.yahoo.com/search?p=site%3A<?php echo $site2; ?>&ei=UTF-8&fr=sfp&n=20&fl=0&x=wrt" target="_blank">Pages indexées</a><br>
<li>Améliorer le <a href="http://referencement.utilisable.com/index.php?au=<?php echo $num_au; ?>" title="Améliorer le référencement de ce site">référencement</a> de <a href="<?php echo $row['url']; ?>"><?php echo $site; ?></a><br>
<br>
<br>
</ul>
<form>
<div align="center">
<input type="button" value="Retour Page Précédente" onclick="java script:history.back();" class="button_close_annuaire"></div>
</form>
<br>
<?php
// on ferme la connexion à mysql
//mysql_close($req);
?></div>
</td>
</tr>
</table>
</div>
<div class="c">
<div class="c1"></div>
<div class="c3"></div>
<div class="c2">Les sites au hasard</div>
</div>
<div class="text_centre">
<p><?php
affichage_sites_aleatoire('5','');
?></p>
<hr size="1" color=#ff7d08>
<br>
</div>
<div class="pub" style="width: 468px;">
<script type="text/javascript"><!--
google_ad_client = "pub-4569128370061072";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_type = "text";
google_ad_channel = "";
google_color_border = "FFFFFF";
google_color_bg = "FFFFFF";
google_color_link = "0066CC";
google_color_text = "191919";
google_color_url = "B3B3B3";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
</div>
<div id="footer">
<div class="menu_h">
<div class="menu_h1"></div>
<div class="menu_h3"></div>
<div class="menu_h2">
<?php
// NE PAS MODIFIER LE COPYRIGHT CI-DESSOUS
include ("bas.php");
?></div>
</div>
</div>
<center><?php
// NE PAS MODIFIER LE COPYRIGHT CI-DESSOUS
include ("http://adm2.utilisable.com/copyright.php");
?></center>
</body>
</html>
Et voici l'erreur qui me mes
Citation
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
Romain
++