RE: [PHP] The CSS battle continues...
| From: | Matt Giddings | Date: | Thu, 24 Oct 2002 16:23:03 +0000 |
| Subject: | RE: [PHP] The CSS battle continues... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-121307@lists.php.net to get a copy of this message | ||
I know that this thread is old and you've probably moved on to something
bigger and better, but I couldn't resist.
Could you send a snippet of code that you using. I'm thinking I'd take
a slightly different approach to your problem. Is there a reason why
your linking to an external file? Seems to me that it would be easier
to code is something like this:
.php or .html file
...
<style type="text/css">
<?php
include 'cssStyle.inc';
?>
...
cssStyle.inc
<?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);
}
}
?>
Matt
> -----Original Message-----
> From: Liam.Gibbs@dfait-maeci.gc.ca
[mailto:Liam.Gibbs@dfait-maeci.gc.ca]
> Sent: Thursday, October 24, 2002 8:02 AM
> To: php-general@lists.php.net
> Subject: RE: [PHP] The CSS battle continues...
>
> <<I've been somewhat following this thread but I'm still not sure what
is
> trying to be accomplished. Could you generate the .css file (or
whatever
> extention is desired) then dynamically generate the <link .../> tag
for
> the
> html document and send that? Each .css file would need to have a
unique
> name or else someone else's .css file could clobbered.>>
>
> Basically, I'm trying to dynamically create a single CSS file. None of
the
> settings will conflict with any other settings. But the reason I want
PHP
> to
> create it is because I want users to be able to set their own colour
> settings and whatnot, so I need to plunge into a MySQL database,
retrieve
> some info, and create the CSS based off of that. Everything is in
place,
> but
> the CSS stops running after it hits the first IF statement.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
> ---
> Incoming mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.399 / Virus Database: 226 - Release Date: 10/9/2002
>
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.399 / Virus Database: 226 - Release Date: 10/9/2002