how can I include a global variable into the style.php file? Basically a php stylesheet.
this is main file:
<?php
function (){
$gbvariable = get_option();
?>
<input type="text" size="20" name="backgroundcolor" value="<?php $gbvariable; ?>"/>
<?php
}
?>
this is the style.php file.
<?php header('Content-Type: text/css');?>
#div{
background: <?php $gbvariable; ?>;
}
You will have to pass the variable to style.php somehow, since it is not loaded until the page is rendered by the browser. So your stylesheet href would be
"style.php?gbvariable=<?php echo $gbvariable; ?>"and you could then use$_GET['gbvariable']in stylesheet.php.