Jump to content

W3 Validator


xbl1

Recommended Posts

Hi;I am implementing a search engin by php, and i alway to have a error massage when i validate my page by the W3 Validator, error massage as following, could any one help, thanks.end tag for "div" omitted, but OMITTAG NO was specifiedQuery was emptyYou may have neglected to close an element, or perhaps you meant to "self-close" an element, that is, ending it with "/>" instead of ">". my code

<?php   $rows = get_number_of_rows();	function get_number_of_rows(){	   include("../condatabase.php");	   mysql_query("SET NAMES 'utf8' COLLATE 'utf8_general_ci'");	   $q=getsql("affair with teen");	   $result=mysql_query($q,$con)or die(mysql_error());	   $rows = mysql_num_rows($result);	   return $rows;  	}   function getsql($search_str){	 $sql = "SELECT DISTINCT COUNT(*) as occurences,id, subject, content FROM pinboard WHERE (";			     while ( list ( $key,$val ) = each ( $search_str ) )   {				if( $val!='' && strlen ( $val ) > 0 )				{				 $sql .= "((subject LIKE '%".$val."%' OR content LIKE '%".$val."%')) OR";				}   }  						$sql=substr ( $sql,0, ( strLen ( $sql )-3 ) );//this will eat the last OR   //$sql .= ") GROUP BY subject ORDER BY occurences DESC LIMIT 10";					   $sql .= ") GROUP BY subject ORDER BY occurences DESC ";	  				return $sql;   } ?>

but when i direct assign value to $sql="SELECT DISTINCT COUNT(*) as occurences,id, subject, content FROM pinboard WHERE (((subject LIKE '%affair%' OR content LIKE '%affair%')) OR((subject LIKE '%teen%' OR content LIKE '%teen%'))) GROUP BY subject ORDER BY occurences DESC"and validate my page by W3 validator, it has not report any error, pefect.Could anyone tell me, why please.

Link to comment
Share on other sites

You don't seem to have posted your HTML. Are you trying to validate your PHP code as HTML?

Link to comment
Share on other sites

i pasted my website address to W3 to validate it, then it give me the error massage. But now, i get the source code from right click on the page, and validate it on the W3 again. It passed. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Yourheadstone.com</title><style type="text/css">* {padding:0; margin:0;}body{ padding:0; border:0; background-image:url(../images/bg_images/2.jpg); margin:0;}#container { width:1024px; height:1005px; margin:30px auto; background-image:url(../images/container_images/5.jpg); border-top: 7px solid #80B2E6; border-right: 5px solid #ADC2DA; border-bottom: 6px solid #ADC2DA; border-left: 5px solid #ADC2DA;}#headertop{ width:1020px; height: 90px; color:#0066CC; font-size:70px; padding-left:200px; float:left;}.logo{ margin-left:65px; margin-top:20px; font-style:italic;}a{ color:#0066CC; text-decoration: none;}#headermiddle{ width:1020px; height: 45px; float:left;}#headermiddle_left{ width:600px; height: 45px; float:left;}#headermiddle_right{ width:400px; height: 45px; float:left;}form{ width: auto; height: 38px; text-align:center; background-color:#000000;}input{ line-height: 25px; font-size: 18px; height: 30px; width: 195px;; }#headerbottom{ width:1020px; height: 45px; background-color:#0AC20A; float:left;}.pagenums{ color:#0C14F7;}.page{ color:#0C14F7;}.mypage{ background-color:#A7A8B8;}img { border-style:none;}#leftcolumn{ width:150px; height:560px; float:left;}#middlecolumn{ border-top: 7px solid #0A0A0A; border-right: 5px solid #948F91; border-bottom: 6px solid #A89D9F; border-left: 5px solid #8C8587; padding:10px; width:720px; height:560px; float:left; background-color:#FFFFFF;} .submittime{ color:#00010A; width:150px; height:20px; float:left;}#rightcolumn{ width:100px; height:560px; float:left;} </style></head><body><div id="container"><div id="headertop"> <a href="index.php"> <span class="logo"> your headstone</span> </a></div><div id="headermiddle"><div id="headermiddle_left"><a href="index.php"> <img src="../images/flower.gif" alt="image" /></a></div><div id="headermiddle_right"><form action="../search_pinboard/search_pinboard_process.php" method="post"><input type="text" name="search" value="" size="30"/><input type="submit" value="search" /></form></div></div><div id="headerbottom"><div id="result">Total 2 images.<br /></div> page 1 of 1-- <a class="mypage" href='/search_pinboard/search_pinboard.php?pagenum=1'> 1 </a></div><div id="leftcolumn"> </div><div id="middlecolumn"><a href="../pinboard/pinboard_massage.php?id=3">i am testing</a><br />Only photo:Images of dead Melbourne son on stolen camera<br /><br />Royal lookalikes:Kate and Mary\\\\\\\\\\\\\\\'s double date for charity<br /><br />Lazy extreme:Wife\\\\\\\\\\\\\\\'s food spiked to make her stay-at-home mum<br /><br />Dead babysitter:Couple had drug-fuelled affair with teen help<br /><div class="submittime"></div><br /><br /><a href="../pinboard/pinboard_massage.php?id=2">job test me</a><br /><img src="../images/biggrin.gif" alt="image" /> <img src="../images/smile.gif" alt="image" /> Only photo:Images of dead Melbourne son on stolen cameraRoyal lookalikes:Kate and Mary\\\'s double date for charityLazy extreme:Wife\\\'s food spiked to make her stay-at-home mumDead babysitter:Couple had drug-fuelled affair with teen help<br /><div class="submittime"></div><br /><br /></div><div id="rightcolumn"> </div></div></body></html>

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...