<?php
if(isset($_REQUEST["msg"])) {
?>
<tr>
<td align="center" colspan="3"><font color="#FF0000"><b><?php echo $_REQUEST["msg"];?></b></font></td>
</tr>
<?php
}
?>
So, what are the advantages of the code above vs. the code below?
<?php
if(isset($_REQUEST["msg"])) {
echo " <tr>".
" <td align=\"center\" colspan=\"3\"><font color=\"#FF0000\"><b>".$_REQUEST["msg"]."</b></font></td>".
" </tr>";
}
?>
Is it just preference? Personally, I like the one on the bottom, way too many opening and closing tags and 2 less lines. I DO NOT have short_open_tags enabled.
We purchased a script from a developer and his code is loaded with the style on top. His coding style is absolutely atrocious. I also believe there were multiple developers because in some code he had structures like this:
for($i=0;$i<$record;$i++):
if($name==strtoupper($array[$i]['title'])):
$found=1;
break;
else:
$found=0;
endif;
endfor;
Yes, it also included no indention. They also developed the HTML using Dreamweaver and the HTML is horrible. No templating at all. I have a good mind to redo his code and start selling the script myself.