Jump to content

PHP formatting error with HTML


PC Nerd

Recommended Posts

ok, ive echod out a table, 4 sections, 2 on top and 2 on the bottom.  now the bottem left imag is being displayed before the table is even created.... could anyone help me with this:



[code]html>

<head>
<link rel="stylesheet" type="text/css" href="B_A-CSS.css">
<title>Battle Ages Login</title>
</head>

<body>

<table>

<thead>
<td class = 'left'>
<img src="Graphics\Small_Logo.GIF" alt="Logo" width = '75%' hight = '75%' align = 'left'>
</td>

<td class = "centre">
</td>

<td class = 'right'>
<img src="Graphics\Small_Logo.GIF" alt="Logo" width = '75%' hight = '75%' align = 'right'>
</td>

</thead>

<tbody>

<tr hight="250">

<td width="20%">
</td>

<td width="60%" hight="75">
<b>
<center>
<h1>BASE</h1>
</center>
</b>

<?php #40

if(!$_COOKIE){
echo "Please login again.  <a href= 'B_A-Home.php'>log in again here</a>";
}

else{### Display normal page

require("inc_files/Database_link.inc");
$User_Name = $_COOKIE['User_Name'];
$General_Stats_SQL = "SELECT Points, Research, Sustainability, Attack, Defense, Friends, Units, Resource_1 FROM General_Stats WHERE User_Name = '".$User_Name."'";
$Query = mysqli_query($DB_Server, $General_Stats_SQL);
#echo $General_Stats_SQL;
$Stats = mysqli_fetch_array($Query);
$Stats['M_Power'] = $Stats['Attack'] + $Stats['Defense'] /2;




echo "<center>";
echo "<table width='100%' hight='75'>";
echo "<tr hight='200'>";
echo "<td width='50%' hight='50'>";
echo "<p>POINTS: ".$Stats['Points']."</p>";
echo "<p>RESEARCH COUNT: ".$Stats['Research']."</p>";
echo "<p>SUSTAINABILITY: ".$Stats['Sustainability']."</p>";
echo "<p>MILITARY POWER: ".$Stats['M_Power']."</p>";

echo "<blockquote>";
echo "<p>ATTACK: ".$Stats['Attack']."</p>";
echo "<p>DEFENSE: ".$Stats['Defense']."</p>";
echo "</blockquote>";
echo "<p>FRIENDS: ".$Stats['Friends']."</p>";


echo "</td>";

echo "<td width='50%' hight='50'>";
echo "<h2>Preferances</h2>";

echo "</td>";

echo "</tr>";


echo "<tr hight='200>";

[color=yellow]echo "<td width='50%' hight=50'>";
echo "<h3>RECENT RESEARCH</h3>";
echo "<img src='Graphics\TECHS.GIF' alt='Techs'>";

echo "</td>";[/color]

echo "<td width='50%' hight='50'>";
echo "RECENT SITE DOVELOPMENTS";
echo "</td>";

echo "</tr>";
echo "</table>";
echo "</center>";



}
?>


</td>

<td width="20%">
</td>

</tr>
</tbody>
</table>

</body>

</hmtl>
[/code]

the yellow code is being displayed before the table is created???

any suggestions as to why this is happening.... is it my HTML???
Link to comment
https://forums.phpfreaks.com/topic/35072-php-formatting-error-with-html/
Share on other sites

You have an unclosed quote...

echo "<tr hight='200>";

There is no ' after the 200 which makes the browser think everything after it is still part of the value.  Add it in and it may fix it.  I would advise using an editor that does syntax highlighting (http://www.editplus.com/ is good) as it makes spotting things like this easy.

I am sure it's spelt height also.

Hope it works!  :)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.