Code : Tout sélectionner
body { font-family: Geneva, Arial, Helvetica, sans-serif; font-size: 0.8em; color: #003366; background-color: #6D7F91; margin: 0; padding: 0; } a:hover { color: #CC0000; text-decoration: none; } #conteneur1 { position: absolute; width: 90%; margin: 20px 35px 35px 35px; padding: 15px; background-color: #FFFFFF; } #conteneur2 { width: 98%; margin: 5px; padding: 0px; background-color:#FFFFFF; border: 3px solid #CEAA18; } #header { height: 80px; background-color: #FFFFFF; text-align: center; margin-top: 20px; } #haut { background-color: #FFCC00; border: 1px solid #CEAA18; text-align: center; margin: 20px 15px 10px 15px; height: 25px; } #centre { background-color:#FFFFFF; margin-left: 170px; margin-right: 170px; text-align: justify; padding: 15px; margin-top: 27px; } #gauche { float: left; left: 0px; margin-top: 20px; width: 150px; padding: 15px; } #incrustationgauche { float: left; right:0; margin-top: 20px; width: 150px; padding: 15px; } #droite { float: right; right:0; margin-top: 20px; width: 150px; padding: 15px; text-align: center; } #pied { clear: both; height: 80px; margin-top: 30px; background-color: #FFFFFF; text-align: center; } .menuhaut { list-style-type: none; margin: 0px; padding: 5px; } .menuhaut li { display: inline; } .menuhaut a { margin: 0 3px; color: #003366; font-weight: bold; text-decoration: none; } .menuhaut a:hover { text-decoration: none; font-weight: bold; color: #CC0000; } .header_titre { font-weight: bold; } .menugauche { list-style-type: square; margin: 0; padding: 0px 10px 0px 15px; list-style-image: url(images/fleche.gif); } .menugauche_titre { font-weight: bold; text-decoration: underline; } .menugauche li { margin-bottom: 5px; } .menugauche a { margin: 0; text-decoration: none; } .menugauche a:hover { text-decoration: none; color: #CC0000; } .menucentre_titre { font-weight: bold; color: #CC0000; font-size: 1.3em; } p { margin: 0 0 15px 0; } .gras { font-weight: bold; margin: 0 0 15px 0; } .italique { font-style: italic; margin: 0 0 15px 0; } .tableau { text-align: left; background-color: #E2E2E2; border: 1px solid #CCCCCC; margin: 0px 0px 30px 0px; vertical-align: top; }
Code : Tout sélectionner
<link href="css.php" rel="stylesheet" type="text/css" />
<? include ("css.php"); ?>
puis la css.php de cette façon (attention de ne pas oublier les balises <style></style>):<?php
include ("connect.inc");
$table_css="css";
$rq="SELECT body_color, body_font, body_font_color, contener_border_color, navigation_background_color FROM $table_css WHERE site_accn='$site_accn'";
$sq=mysql_query($rq);
while ($ligne=mysql_fetch_array($sq)) {
$color=$ligne['body_color'];
$font=$ligne['body_font'];
$font_color=$ligne['body_font_color'];
$cont_bdr_color=$ligne['contener_border_color'];
$nav_bgd_color=$ligne['navigation_background_color'];
}
?>
<style type="text/css">
body {
font-family: <?php echo $font; ?>;
font-size: 0.8em;
color: <?php echo $font_color; ?>;
background-color: <?php echo $color; ?>;
margin: 0;
padding: 0;
}
a:hover {
color: #CC0000;
text-decoration: none;
}
#conteneur1 {
position: absolute;
width: 90%;
margin: 20px 35px 35px 35px;
padding: 15px;
background-color: #FFFFFF;
}
#conteneur2 {
width: 98%;
margin: 5px;
padding: 0px;
background-color:#FFFFFF;
border: 3px solid <?php echo $cont_bdr_color; ?>;
}
#header {
height: 80px;
background-color: #FFFFFF;
text-align: center;
margin-top: 20px;
}
#haut {
background-color: <?php echo $nav_bgd_color; ?>;
border: 1px solid #CEAA18;
text-align: center;
margin: 20px 15px 10px 15px;
height: 25px;
}
#centre {
background-color:#FFFFFF;
margin-left: 170px;
margin-right: 170px;
text-align: justify;
padding: 15px;
margin-top: 27px;
}
#gauche {
float: left;
left: 0px;
margin-top: 20px;
width: 150px;
padding: 15px;
}
#incrustationgauche {
float: left;
right:0;
margin-top: 20px;
width: 150px;
padding: 15px;
}
#droite {
float: right;
right:0;
margin-top: 20px;
width: 150px;
padding: 15px;
text-align: center;
}
#pied {
clear: both;
height: 80px;
margin-top: 30px;
background-color: #FFFFFF;
text-align: center;
}
.menuhaut {
list-style-type: none;
margin: 0px;
padding: 5px;
}
.menuhaut li {
display: inline;
}
.menuhaut a {
margin: 0 3px;
color: #003366;
font-weight: bold;
text-decoration: none;
}
.menuhaut a:hover {
text-decoration: none;
font-weight: bold;
color: #CC0000;
}
.header_titre {
font-weight: bold;
}
.menugauche {
list-style-type: square;
margin: 0;
padding: 0px 10px 0px 15px;
list-style-image: url(images/fleche.gif);
}
.menugauche_titre {
font-weight: bold;
text-decoration: underline;
}
.menugauche li {
margin-bottom: 5px;
}
.menugauche a {
margin: 0;
text-decoration: none;
}
.menugauche a:hover {
text-decoration: none;
color: #CC0000;
}
.menucentre_titre {
font-weight: bold;
color: #CC0000;
font-size: 1.3em;
}
p {
margin: 0 0 15px 0;
}
.gras {
font-weight: bold;
margin: 0 0 15px 0;
}
.italique {
font-style: italic;
margin: 0 0 15px 0;
}
.tableau {
text-align: left;
background-color: #E2E2E2;
border: 1px solid #CCCCCC;
margin: 0px 0px 30px 0px;
vertical-align: top;
}
</style>
<LINK REL="stylesheet" HREF="<?php echo($ChatPath); ?>config/start_page.css.php3?<?php echo("Charset=${Charset}&medium=${FontSize}&FontName=${FontName}"); ?>" TYPE="text/css">
en plus ils mettent du php dans la css et n'utilise pas la balise <style> (normal puisque l'attribut REL le définit déjà)
$rq = "SELECT body_color, body_font, body_font_color, contener_border_color, navigation_background_color FROM " . $table_css . " WHERE site_accn='" . $site_accn . "'";
Elle est beaucoup plus claire et t'évitera des PB si tes variables sont des données de tableaux.
Je parie que c'est un paramètre passé en GET !Je repose ma question.![]()
Ou la variable $site_accn est-elle initialisée ?
Tu ne devrais donc pas l'exploiter sous cette forme $_SESSION['site_accn'] avec un session_start();.Effectivement, ce n'est pas ma requête qui pose problème... mais pour satisfaire la curiosité de pjl, la variable $site_accn est une variable de session