Jump to content

Validator Errors


Xtremer360

Recommended Posts

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
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.