Xtremer360 Posted March 24, 2010 Share Posted March 24, 2010 I'm getting a lot of errors from the validator but not sure how to correct them and the majority of them are coming from the function below. http://validator.w3.org/check?uri=http%3A%2F%2Fwww.kansasoutlawwrestling.com%2Findex.php&charset=%28detect+automatically%29&doctype=Inline&group=0 function top5(){ $query = "SELECT * FROM `efed_list_top5` ORDER BY `id` DESC LIMIT 1"; if(!$result = mysql_query($query)){ debug($query); } $row = mysql_fetch_assoc($result); $labels = array('bio1_id' ,'bio2_id', 'bio3_id', 'bio4_id', 'bio5_id'); $chars = array('char1', 'char2', 'char3', 'char4', 'char5'); for($i = 0; $i < count($labels); $i++){ if($row[$labels[$i]] != 0){ $query2 = "SELECT * FROM `efed_bio` WHERE `id` = '" . $row[$labels[$i]] . "'"; $result2 = mysql_query($query2); $row2 = mysql_fetch_assoc($result2); $last_rank = 'N/A'; $query3 = "SELECT * FROM `efed_list_top5` WHERE `id` = '" . $row['id'] - 1 . "'"; if($result3 = mysql_query($query3)){ $row3 = mysql_fetch_assoc($result3); for($p = 0; $p < count($labels); $p++){ if($row3[$labels[$p]] == $row[$labels[$i]]){ $last_rank = $p + 1; } } } print '<span class="block red_text">' . ($i + 1) . '. ' . $row2['charactername'] . '(' . $last_rank . ')</span>'; } else{ print '<span class="block red_text">' . ($i + 1) . '. TBA</span>'; } } } Link to comment https://forums.phpfreaks.com/topic/196324-validator-errors/ Share on other sites More sharing options...
slurpee Posted March 24, 2010 Share Posted March 24, 2010 This should probably be in HTML help, but it looks like you have a <span> tag immediately following an <ol> tag. As the error on the validation page states (and quoted below), this isn't valid HTML according to XHTML 1.0 Transitional. It is expecting an <li> tag after an <ol> tag. Line 105, Column 33: document type does not allow element "span" here; assuming missing "li" start-tag Try changing to this: for($i = 0; $i < count($labels); $i++){ print '<li>'; if($row[$labels[$i]] != 0){ /// All 'if' stuff here } else { /// All 'else' stuff here } print '</li>'; } Link to comment https://forums.phpfreaks.com/topic/196324-validator-errors/#findComment-1030940 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.