The CSS battle continues...
| From: | Liam dot Gibbs at dfait-maeci dot gc dot ca | Date: | Wed, 23 Oct 2002 16:39:53 +0000 |
| Subject: | The CSS battle continues... | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-121129@lists.php.net to get a copy of this message | ||
Well, I've made progress. Found below this message is my CSS file, in PHP. I
figured out now that if I make a linked style sheet by way of <LINK REL =
\"STYLESHEET\" HREF = \"Stylesheet.php\" TYPE = \"TEXT/CSS\">, what
it will
do is it will run the sheet properly until it reaches the first IF
statement. If I include the style sheet, though, it runs it properly. Any
ideas?
=========================
<?PHP
print("BODY { Color: #FFFFFF; Background-Color: #000000; Text-Align:
Justify; Scrollbar-Base-Color: #005500;\n");
print("TD { Padding-Left: 5px; Padding-Right: 5px; }\n");
print("A { Color: #FF0000; Text-decoration: None; Font: Bold;
Font-Family: Schoolbook; }\n");
print(".regular { Text-Align: Justify; }\n");
print(".title { Color: #FFFFFF; Background-Color: #000000;
Text-Align: Center; Font: Bold; Line-Height: 3em; }\n");
print(".header { Color: #FFFFFF; Background-Color: #000000; Font:
Bold; }\n");
print(".bulletin { Color: #FFFFFF; Background-Color: #000000; Color:
#0000FF; }\n");
print(".fineprint { Color: #FFFFFF; Background-Color: #000000;
Font-Size: X-Small; }\n");
print(".error { Color: #FF0000; Background-Color: #000000;
Text-Align: Center; }\n");
print(".confirmation { Color: #FFFFFF; Background-Color: #000000;
Text-Align: Center; Font: Bold; }\n");
print(".footer { Color: #FFFFFF; Background-Color: #000000;
Font-Size: X-Small; }\n");
if(($page == "Grate") && ($code != "") && ($method !=
"")) {
if(($connection = @mysql_connect("localhost", "root", ""))
&& (mysql_select_db($databasesource))) {
$query = mysql_query("SELECT Formatting FROM method
WHERE Code='$code'");
if($result = mysql_fetch_row($query)) {
$components = explode($result[0], ",");
print("P { Color: #$components[0];
Background-Color: #000000; Text-Align: Justify; Text-Indent: 10px; }\n");
print(".method-title { Color:
#$components[1]; Background-Color: #000000; Text-Align: Center; }\n");
print(".method-majorbreak { Color:
#$components[2]; Background-Color: #000000; Text-Align: Justify; }\n");
print(".method-minorbreak { Color:
#$components[2]; Background-Color: #000000; Text-Align: Center; }\n");
print(".method-footnotereference { Color:
#$components[3]; Background-Color: #000000; Font-Variant: Superscript;
}\n");
print(".method-footnote { Color:
#$components[4]; Background-Color: #000000; }\n");
}
@mysql_close($connection);
}
}
?>