You are doing too much work. It'd be easier to do it this way.
<?
$selected_bgcolor = "#000000";
$section1_bgcolor = "#FFFFFF";
$section2_bgcolor = "#FFFFFF";
$section3_bgcolor = "#FFFFFF";
if ($condition = "1.php") {
$section1_bgcolor = $selected_color;
}
else if ($condition = "2.php") {
$section2_bgcolor = $selected_color;
}
else {
$section3_bgcolor = $selected_color;
}
?>
<table>
<tr>
<td bgcolor="<? echo $section1_bgcolor; ?>">FIRST PART</td>
<td bgcolor="<? echo $section2_bgcolor; ?>">SECOND PART</td>
<td bgcolor="<? echo $section3_bgcolor; ?>">THIRD PART</td>
</tr>
</table>
This way sets all of your sections to the unselected color, then just does one statement to change whichever section matches your criteria. You could also use a switch statement instead of an if..else,
switch($condition) {
case "1.php"
$section1_bgcolor = $selected_color;
break;
case "2.php"
$section2_bgcolor = $selected_color;
break;
case "3.php"
$section3_bgcolor = $selected_color;
break;
}