I have tried to implement the fix as suggested, and here is my error message, which I will follow with the code:
Warning: Cannot modify header information - headers already sent by (output started at /home/iceregen/public_html/bands/template/include/config.php:1) in /home/iceregen/public_html/bands/template/themes/default/css.php on line 2
Here is the index file that is trying to get the css info from the database:
<?php
session_start();
//read config file
include '../template/include/config.php';
if($_GET['website'] <> NULL) {
$_SESSION['website'] = $_GET['website'];
}
$web=$_SESSION['website'];
//echo $web;
$result = mysql_query("SELECT bid , band , theme , links , center , cogs , footer FROM band WHERE band LIKE '$web'") or exit(mysql_error());
while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
$cssstyle = "../template/themes/" . $row['theme'] . "/css.php";
$leftcontent=$row['links'];
$centercontent=$row['center'];
$rightcontent=$row['cogs'];
$footercontent=$row['footer'];
}
echo '<head>';
echo '<title>' . $web . ' Band Pages</title>';
//echo '<link rel="stylesheet" type="text/css" href=" ' . $cssstyle . '">';
include $cssstyle;
echo '</head>';
echo '<body>';
Here is the 'css/php' file I tried to implement as suggested:
<?php
header('Content-Type: text/css');
$web=$_SESSION['website'];
$result = mysql_query("SELECT * FROM colors WHERE band LIKE '$web'") or exit(mysql_error());
$bcolor = $row['body'];
$h1color = $row['headerh1'];
$menufore = $row['menufore'];
$menuli = $row['menu li'];
$menua = $row['men a'];
$hover = $row['hover'];
$hoverback = $row['hoverback'];
$leftfore = $row['leftfore'];
$leftback = $row['leftback'];
$centerfore = $row['centerfore'];
$centerback = $row['centerback'];
$rightfore = $row['rightfore'];
$rightback = $row['rightback'];
$footfore = $row['footer'];
?>
body
{
background-color: <?php echo $bcolor; ?>;
}
.header
{
padding: 5px 0px 0px 5px;
width: 100%;
position: absolute;
top: 0px;
left: 0px;
}
.header h1
{
position: absolute;
top: 0px;
left: 300px;
font-size: 48px;
color: <?php echo $h1color; ?>;
}
That is just a partial listing of the css file, but you can see where the color codes have been replaced with variables. I am not sure where to begin troubleshooting right now. Any ideas?
Here is the subweb that I am trying to develop out. The url is going to be part of a larger portal, but for now, it is just a basic layout Click on the BandWebPages links, and then choose the 'default' website. http://bands.iceregent.com
Thanks;
Ice