Hi!
how can i increase a variable in a php Heredoc?
i want a user to change text-size.
in site.css.php:
h1 {
font-size : $text_size + 1$px;
}<?php
header("Content-type: text/css");
require_once('../CMS/config.inc.php');
$text_size = $_SESSION['text_size'];
$px = 'px';
$str = <<<DEMO
h1 {
font-size : $text_size + 1$px;
}
DEMO;
echo $str;
?>
and on index.php:
<?php
if(session_is_registered('text_size') ){
if(isset($_GET[size_plus])){
$_SESSION['text_size'] = $_SESSION['text_size'] + 2;
}
if(isset($_GET[size_minus])){
$_SESSION['text_size'] = $_SESSION['text_size'] - 2;
}
}else{
$_SESSION['text_size'] = '10';
}
echo '<a class="normlink" href=" $_SERVER['PHP_SELF'] ?size_plus">plus</a> | <a class="normlink" href=" $_SERVER['PHP_SELF'] ?size_minus">minus</a>';
?>
i cant get this working in site.css.php:
h1 {
font-size : $text_size + 1$px;
}when i look at the html-sorce in my browser it prints:
....
font-size : 10 + 1px; // (exactly this)
....
i also tried it with brackets and points and quotes without success.it doesnt encrease the the variablethanks for helping.
till.