My dynamic pages are built by first including a header and a stylesheet. In the stylesheet I declare variables such as fontsize and fontcolor and use those variables in the style sheet code. I want to allow my users to modify those values during their session. But as each page uses the stylesheet, my user changed values get reset to their initial values, when the script is called. Here is some clearer example code:
STYLESHEET:
\called every time a page loads
\declare default values
$fontweight2 = "bold";
$fonttype= "Verdana";
$navFontSize = "10";
$color = "7F1B33";
\declare styles
<STYLE type="text/css">
.HeadlineBold {
font-family : <? echo $fonttype; ?>;
font-weight : <? echo $fontweight2; ?>;
font-size : <? echo $navFontSize)."pt"; ?>;
color : <? echo $color; ?>;
}
</STYLE>
CONFIGURATION PAGE:
\User modifies values page
<? include ("stylesheet.php"); ?>
<? session_start(); ?>
<form action="config2.html" method=POST>
Choose your size text:
<SELECT NAME="newNavFontSize">
<OPTION VALUE="8">Small</option>
<OPTION VALUE="10">Normal</option>
<OPTION VALUE="12">Large</option>
<OPTION VALUE="14">Huge</option>
</SELECT><br>
<INPUT TYPE="submit" VALUE="Bite Me!"><P>
</form>
<? session_register("newNavFontSize");
$navFontSize = $newNavFontSize; >?
Now the new value is in navFontSize but it rightly gets reset to it's default value once the stylesheet is called.
How do I change the value for the duration of the user session? I know this is PHP 101 but I am new to the game and would appreciate any and all advice. More details upon request.
Thanks,
James