if else ??

admin

Administrator
Staff member
hi,

there were 3 pages as 1.php, 2.php and 3.php and all pages contains the table which i work on.
i want,
if a person enters 1.php, FIRST PART bgcolor will be black and others are white,
if 2.php, SECOND PART black ...

anyway what should my if condition
<?
$selected_bgcolor = "#000000";
$not_selected_bgcolor = "#FFFFFF";

?>

<table>
<tr>
<td bgcolor="<? if (condition){
echo "$selected_bgcolor";
}
else {echo "$not_selected_bgcolor"; }
?>">FIRST PART</td>
<td bgcolor="<? if (condition){
echo "$selected_bgcolor";
}
else {echo "$not_selected_bgcolor"; }
?>">SECOND PART</td>
<td bgcolor="<? if (condition){
echo "$selected_bgcolor";
}
else {echo "$not_selected_bgcolor"; }
?>">THIRD PART</td>
</tr>
</table>
 
Back
Top