Помогнете ми с валидацията на код

hackera

Registered
Помогнете ми с валидацията на този код
Код:
<table width="455" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#FAFAE8">
<tr>
<?php
include ("config.php");
$i="0";
mysql_connect($server, $dbusername, $dbpassword);
@mysql_select_db($db_name) or die("Unable to select database");
$chars="SET CHARACTER SET cp1251";mysql_query($chars);
$query="SELECT * FROM cats ORDER BY cat ASC";
$result=mysql_query($query);
while ( $red = mysql_fetch_array( $result )){
$id_cat=$red[id_cat];
$cat=$red[cat];
mysql_connect($server, $dbusername, $dbpassword);
@mysql_select_db($db_name) or die("Unable to select database");
$chars="SET CHARACTER SET cp1251";mysql_query($chars);
$TRecord = mysql_query("SELECT * FROM `vicove` WHERE `id_cat`='$id_cat' AND `ad`='1'");
$RecordCount = mysql_num_rows($TRecord);
$i++;
echo "<td><a href=\"cats.php?id=".$id_cat."\">".$cat."</a> (".$RecordCount.")</td>";
 if ($i=="3"){
  echo "</tr>
  <tr>";
  $i=0;
}
}
?>
</tr>
</table>

дава ми тази грешка като валидирам с http://validator.w3.org/ :oops:
 
каква грешка ти дава дай валидирай сайта и дай резултата не мога да ти помогна само така с кода.
 
Ето какво ми дава http://validator.w3.org/check?uri=http%3A%2F%2Fenjoy-bg.net%2Fvicove.php&charset=%28detect+automatically%29&doctype=Inline&group=0
 
Ами махни / от <br />

Аз много се чудя защо навсякъде ги слагате тези.Когато един таг е без завършващ таг, като <img>, например слагате / преди крайния >...
 
Дава ми грешка при този таг Line 221, Column 10: end tag for "TR" which is not finished.

<tr></tr>



Most likely, you nested tags and closed them in the wrong order. For example <p><em>...</p> is not acceptable, as <em> must be closed before <p>. Acceptable nesting is: <p><em>...</em></p>

Another possibility is that you used an element which requires a child element that you did not include. Hence the parent element is "not finished", not complete. For instance, in HTML the <head> element must contain a <title> child element, lists (ul, ol, dl) require list items (li, or dt, dd), and so on.
 
hackera каза:
Дава ми грешка при този таг Line 221, Column 10: end tag for "TR" which is not finished.

<tr></tr>



Most likely, you nested tags and closed them in the wrong order. For example <p><em>...</p> is not acceptable, as <em> must be closed before <p>. Acceptable nesting is: <p><em>...</em></p>

Another possibility is that you used an element which requires a child element that you did not include. Hence the parent element is "not finished", not complete. For instance, in HTML the <head> element must contain a <title> child element, lists (ul, ol, dl) require list items (li, or dt, dd), and so on.

отваряш нов таг <tr> преди да си затворил предния </tr>

a ако са правилно отворени и затворени, то тогава нямаш <td></td> м-у тях
 

Back
Горе