<select name="bgColour">
<?php
// Create an array of the possible image positions
$bgColourArray = Array(''=>'Use Hex Value -->',
'Red'=>'<font colour="Red">Red</font>',
'Turqoise'=>'Turqoise',
'Light Blue'=>'Light Blue',
'Dark Blue'=>'Dark Blue',
'Light Purple'=>'Light Purple',
'Dark Purple'=>'Dark Purple',
'Yellow'=>'Yellow',
'Pastel Green'=>'Pastel Green',
'Pink'=>'Pink',
);
if (isset($_SESSION['bgColour']))
{
$bgColour = $_SESSION['bgColour'];
}
//Loop through position array
foreach($bgColourArray as $key => $value)
{
//If current position equals the one in the session set as selected. If it does not equal the one in the session set as default.
if ($bgColour == $key)
{
echo "<option value=\"$key\" selected=\"selected\">$value</option>";
}
else
{
echo "<option value=\"$key\">$value</option>";
}
}
?>