title: CSS property customization via PHP sessions?
body: <p>I'm pretty new at PHP, I'm currently taking a class in it at a technical school. With that being said, one of our assignments requires us to use sessions to modify 4 CSS properties. body background-color, a:link color, a:hover color, and h1 color. The idea is to basically have 3 pages -1 being a form, with 4 drop-downs, populated with colors, one setting the actual sessions with $_POST data, and the final being the page that actually uses the CSS.</p>
  
  <p>I have it working with cookies but the assignment explicitly says to use sessions as you can see: </p>
  
  <p>The current code i have that sets the sessions is:</p>
  
  <pre><code>session_start();
  $_SESSION['bgColor']= $_POST['bgColor'];
  $_SESSION['lColor']=$_POST['lColor'];
  $_SESSION['hoverColor']=$_POST['hoverColor'];
  $_SESSION['h1Color']=$_POST['h1Color'];
  </code></pre>
  
  <p>On the same page, there is code under that that echo's out the values of the session variables... I can see the colors that are being saved. But, when i try to echo out the CSS like this:</p>
  
  <pre><code> echo "a:link {color: ".$_SESSION['lColor'].";}";
   echo "a:hover {color: ".$_SESSION['hoverColor'].";}";
   echo "body {background-color: ".$_SESSION['bgColor'].";}";
   echo "h1 {color: ".$_SESSION['h1Color']."; text-align:center;}";
  </code></pre>
  
  <p>Its not working, when I check the page source through my web browser, it shows blank properties:</p>
  
  <pre><code> a:link {color: ;}a:hover {color: ;}body {background-color: ;}h1 {color: ; text-align:center;}     
  </code></pre>
  
  <p>I would really appreciate any help you guys are willing to give, and please keep in mind that this is my first class in PHP. </p>