title: Changing color of text depending on user selection with PHP, CSS and HTML
body: <p>My assignment asks me to make a select list of colors and then use PHP to print a statement in the color selected.  Here's exactly what it said:</p>
  
  <ol>
  <li><p>Make an HTML form with a select-option list with the following color options:
  Red, Blue, and Green.</p>
  
  <p>When the user makes a selection and clicks the submit button display the
  following line in whatever color they selected. If they choose red, for example,
  it would look like...</p>
  
  <p>Color me happy</p></li>
  </ol>
  
  <p>Use a CSS class to set the color of the text.</p>
  
  <p><strong>THIS IS WHAT HE SAID TO DO:</strong></p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>    &lt;p&gt;
      &lt;select name="colorchoice" size="1"&gt;
      &lt;option value="redtext"&gt;Red&lt;/option&gt;
      &lt;option value="bluetext"&gt;Blue&lt;/option&gt;
      &lt;option value="greentext"&gt;Green&lt;/option&gt;
      &lt;/select&gt;
      &lt;/p&gt;
      &lt;p&gt;
      &lt;input type="submit" value="Submit Information"&gt;
      &lt;/p&gt;
  </code></pre>
  
  <p><strong>PHP</strong></p>
  
  <pre><code>    &lt;?php
      $colorvalue = $_POST['colorchoice'];
      print "&lt;span class='".$colorvalue."'&gt; Color me happy.&lt;/span&gt;";
      ?&gt;
  </code></pre>
  
  <p>Obviously, this doesn't work without some CSS, which he so helpfully didn't mention.</p>