Forum Moderators: coopster
if ($cat!= "") {
print ("
<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"95%\" align=\"center\">
<tr>
<td style=\"border-bottom:solid 1px #3366CC;\"><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"#FFFFFF\">
<tr>
<td><img src=\"images/sitelayout/e04.gif\" width=\"21\" height=\"21\" alt=\" \" border=\"0\" align=\"left\"></td>
<td style=\"padding:5px; \"><h1><font color=\"#3366CC\">$Row[title]</font></h1></td>
</tr>
</table></td>
</tr>
<tr>
<td>$body</td>
</tr>
<tr>
<td>
");
require ('dir.php');
print ("
</td></tr>
</table>
");
} else {
$thecat = urldecode($cat);
print ("
<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"95%\" align=\"center\">
<tr>
<td style=\"border-bottom:solid 1px #3366CC;\"><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"#FFFFFF\">
<tr>
<td><img src=\"images/sitelayout/e04.gif\" width=\"21\" height=\"21\" alt=\" \" border=\"0\" align=\"left\"></td>
<td style=\"padding:5px; \"><h1><font color=\"#3366CC\">$thecat</font></h1></td>
</tr>
</table></td>
</tr>
<tr>
<td>
");
$catfile = "dir/".$thecat.".php";
require $catfile;
print ("
</td></tr>
</table>
");
}
I am loading a page into a template page, in this case called 'dirindex.php'. the variable '$cat' will allow the script to load the correct page. but, how can i do it so that if $cat is index or nothing, it will load the first statement and if it isnt index or nothing, it will load the else statement?
Im used to switch conditionals, but this is a bit small for a switch!
any ideas?