/* Nom du fichier: app_connect.php Description: Initialisation de la connection à la base de données */ // Initialisation de la connection à la base de données $connexion = @mysql_connect("localhost","suterweb","NzzTzH7") or die("ERREUR: Impossible de localiser le serveur de base de données"); @mysql_select_db("suterinox_db", $connexion) or die("ERREUR: Impossible de localiser la base de données"); ?> $domain = "http://".$_SERVER['HTTP_HOST']; $lg = substr($_SERVER['REQUEST_URI'],1,2); $lg = ($lg == '') ? 'fr' : $lg; $urlHTML = substr($_SERVER['REQUEST_URI'],4); $urlName = str_replace(".html", "", $urlHTML); $basepath = $domain."/".$lg."/"; $theUrl = 'pages_url_'.$lg; $theTitle = 'pages_title_'.$lg; $theContent1 = 'pages_content_1_'.$lg; $theContent2 = 'pages_content_2_'.$lg; $theContent3 = 'pages_content_3_'.$lg; function label ($arg,$lg){ $sqlLabel = "SELECT ".$lg." FROM tb_labels WHERE name = '".$arg."';"; $resultLabel = mysql_query($sqlLabel) or die("ERREUR3: La requête n'est pas valide: ".mysql_error()); $rowLabel = mysql_fetch_object($resultLabel); return $rowLabel->$lg; } ?> function fct_doDate($date) { $date_year = substr($date, 0, 4); $date_month = substr($date, 4, 2); $date_day = substr($date, 6, 2); $date = $date_day."/".$date_month."/".$date_year; $date = ($date == "//")? $date('d/m/2015') : $date; return $date; } function fct_undoDate($date) { $date_year = substr($date, 6, 4); $date_month = substr($date, 3, 2); $date_day = substr($date, 0, 2); $date = $date_year.$date_month.$date_day; return $date; } ?> $sql = "SELECT * FROM tb_pages WHERE pages_id = '1';"; $result = mysql_query($sql) or die("ERREUR2: La requête n'est pas valide: ".mysql_error()); $row = mysql_fetch_object($result); ?>
print(' ');?> | ||
$sql = "SELECT * FROM tb_pages ORDER BY pages_menu ASC;";
$result_pages = mysql_query($sql) or die("ERREUR: La requête n'est pas valide: ".mysql_error());
while($row_p = mysql_fetch_object($result_pages)){
if($row_p->pages_id == 2) $presentation = $basepath.$row_p->$theUrl.'.html';
if($row_p->pages_id == 3) $nautisme = $basepath.$row_p->$theUrl.'.html';
if($row_p->pages_id == 4) $caravane = $basepath.$row_p->$theUrl.'.html';
if($row_p->pages_id == 5) $brasserie = $basepath.$row_p->$theUrl.'.html';
}
?>
Suter InoxEquipment solutions
$sql_rub = "SELECT * FROM tb_pages WHERE pages_id = '3';";
$result_rub = mysql_query($sql_rub) or die("ERREUR2: La requête n'est pas valide: ".mysql_error());
$row_rub = mysql_fetch_object($result_rub);
?>
$sql_rub = "SELECT * FROM tb_pages WHERE pages_id = '4';";
$result_rub = mysql_query($sql_rub) or die("ERREUR2: La requête n'est pas valide: ".mysql_error());
$row_rub = mysql_fetch_object($result_rub);
?>
$sql_rub = "SELECT * FROM tb_pages WHERE pages_id = '5';";
$result_rub = mysql_query($sql_rub) or die("ERREUR2: La requête n'est pas valide: ".mysql_error());
$row_rub = mysql_fetch_object($result_rub);
?>
|