Problem med php kode
Jeg har et lille problem med denne kode der er en del fejl i den når jeg kører den på validator.w3.orgHer er fejlene:
Line 174, column 206: cannot generate system identifier for general entity "ID"
...estrike.dk/board/index.php?forumID=5&ID=9''><b>hej kaj</b></a></strong></font
^
Line 174, column 206: general entity "ID" not defined and no default entity (explain...).
...estrike.dk/board/index.php?forumID=5&ID=9''><b>hej kaj</b></a></strong></font
^
Line 174, column 208: reference to entity "ID" for which no system identifier could be generated
...trike.dk/board/index.php?forumID=5&ID=9''><b>hej kaj</b></a></strong></font><
^
Line 174, column 205: entity was defined here
...mestrike.dk/board/index.php?forumID=5&ID=9''><b>hej kaj</b></a></strong></fon
^
Line 174, column 211: an attribute specification must start with a name or name token (explain...).
...ke.dk/board/index.php?forumID=5&ID=9''><b>hej kaj</b></a></strong></font><br>
^
Line 175, column 184: reference to entity "ID" for which no system identifier could be generated
...trike.dk/board/index.php?forumID=5&ID=8''><b>fhdhd</b></a></strong></font><..
^
Line 174, column 205: entity was defined here
...mestrike.dk/board/index.php?forumID=5&ID=9''><b>hej kaj</b></a></strong></fon
^
Line 175, column 187: an attribute specification must start with a name or name token (explain...).
...ke.dk/board/index.php?forumID=5&ID=8''><b>fhdhd</b></a></strong></font><br>
^
Line 176, column 184: reference to entity "ID" for which no system identifier could be generated
...trike.dk/board/index.php?forumID=4&ID=7''><b>brug</b></a></strong></font><br>
^
Line 174, column 205: entity was defined here
...mestrike.dk/board/index.php?forumID=5&ID=9''><b>hej kaj</b></a></strong></fon
^
Line 176, column 187: an attribute specification must start with a name or name token (explain...).
...ke.dk/board/index.php?forumID=4&ID=7''><b>brug</b></a></strong></font><br>
Her er koden:
<?php
$dbhostname= "mysql info";
$dbusername= "mysql info";
$dbpassword= "mysql info";
$dbdatabase= "mysql info";
$url= "url info";
$table ="b_posts";
$topfilecount= 5;
$db = @mysql_connect($dbhostname,$dbusername,$dbpassword);
if (!$db) {
echo( "<p>Unable to connect to the " .
"database server at this time.</p>" );
exit();
}
if (! @mysql_select_db($dbdatabase) ) {
echo( "<p>Error locating the file " .
"database at this time.</p >" );
exit();
}
$result = @mysql_query("SELECT ID, title, postforum FROM $table ORDER BY ID DESC", $db);
if (!$result) {
echo("<p>Error performing query: " . mysql_error() . "</p>");
exit();
}
$files = mysql_num_rows($result);
echo "";
$i=1;
$r=0;
while (($myrow = mysql_fetch_row($result)) And ($i<=$topfilecount)){
$r=$r + 1;
$i=$i + 1;
echo "<img src='images/blu2.gif'> <font color='#000' size='2' face='Geneva, Arial, Helvetica, sans-serif'><strong><a target='body' href='$url?forumID=$myrow[2]&ID=$myrow[0]''><b>$myrow[1]</b></a></strong></font><br>\n"; }
echo "\n";
?>
Håber der er en der kan hjælpe....
