This CAN'T work
echo "<table width="100%" border="0" cellspacing="0" cellpadding="0">";
How should PHP know which " is ended by which " ?!?
Try this:
echo "<table width='100%' border='0' cellspacing='0' cellpadding='0'>";
Can you see the diff.? In the upper one, the 100% etc. are blue.
PHP assumes, this is a "command" or something of the like.
This would be more easily:
<? php ?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<?
...
...
//end of script ?>