If your CSS code is in <style tag> in your HTML, then is possible.
But if you use linking to file: <rel link type stylesheet href='mystyle.css'>
and that file 'mystyle.css has got <?php echo $variable; ?>
I dont think it will work
But I think you can do like this.
This is 'mystyle1php.css'
body {
background: <?php echo $body_background; ?>;
color: <?php echo $body_color; ?>;
}
this is 'myhellopage.php'
<?php
$body_background = 'green';
$body_color = 'red';
?>
<html>
<head>
<style type="text/css">
<!--
<?php include 'mystyle1php.css'; ?>
-->
</style>
</head>
<body>
<h1>hello world</h1>
<p><b>Welcome!</b></p>
</body>
</html>
Now by only changing those 2 variables, you can change the style background / color.
And of course you can add $variables for fonts, width, table backgrounds and whatever.
And so store those different variables in different themes config files:
- config_red_theme.php
- config_simple_theme.php
- config_metal_theme.php
... and include different config file in your php
<?php
//include 'config_bluesky_theme.php';
//include 'config_golden_theme.php';
include 'config_metal_theme.php';
?>
<html>
<head>
<style type="text/css">
<!--
<?php include 'mystyle1php.css'; ?>
-->
</style>
</head>
<body>
<h1>hello world</h1>
<p>welcome!</p>
</body>
</html>
Please, if you test a setup of my 2 first files
- 'myhellopage.php'
- 'mystyle1php.css'
... post back here, and tell me if it works.
I guess it can work, but I'd like to know for sure.
thanks
.