Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8

Thread: w3 validate

  1. #1
    Regular Coder
    Join Date
    Dec 2006
    Posts
    306
    Thanks
    24
    Thanked 0 Times in 0 Posts

    w3 validate

    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 empty

    You 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 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 ) > )
                          {
                              
    $sql .= "((subject LIKE '%".$val."%' OR content LIKE '%".$val."%')) OR";
                          }
                }
                
                               
    $sql=substr $sql,0, ( strLen $sql )-) );//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.

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,849
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    Can we have a link to your page?
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    Regular Coder
    Join Date
    Dec 2006
    Posts
    306
    Thanks
    24
    Thanked 0 Times in 0 Posts
    I am sorry, it is not convenient.

  • #4
    Regular Coder
    Join Date
    Oct 2011
    Posts
    236
    Thanks
    11
    Thanked 5 Times in 5 Posts
    W3C Validation is only for HTML.

    I see no HTML within the Php so you are not showing us all of the code, which even if you was this is not a php issue this is a HTML issue.

  • #5
    Regular Coder
    Join Date
    Dec 2006
    Posts
    306
    Thanks
    24
    Thanked 0 Times in 0 Posts
    Thanks a lot, i think i give up this problem. because it does not give any trouble to my website

  • #6
    Senior Coder
    Join Date
    Aug 2010
    Location
    High Point, NC
    Posts
    3,335
    Thanks
    5
    Thanked 363 Times in 360 Posts
    Post the rendered code from right clicking the page in your browser, then click view source. Thats the code you should validate.
    Teed

  • #7
    Regular Coder
    Join Date
    Dec 2006
    Posts
    306
    Thanks
    24
    Thanked 0 Times in 0 Posts
    PHP Code:
    <!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:0margin: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-top7px solid #80B2E6;
      
    border-right5px solid #ADC2DA;
      
    border-bottom6px solid #ADC2DA;
      
    border-left5px solid #ADC2DA;
    }

    #headertop{
      
    width:1020px;
      
    height90px;
      
    color:#0066CC;
      
    font-size:70px;
      
    padding-left:200px;
      
    float:left;

    }

    .
    logo{
      
    margin-left:65px;
      
    margin-top:20px;
      
    font-style:italic;
    }

    a{
      
    color:#0066CC;
      
    text-decorationnone;

    }
    #headermiddle{
      
    width:1020px;
      
    height45px;
      
    float:left;
    }

    #headermiddle_left{
      
    width:600px;
      
    height45px;
      
    float:left;
    }

    #headermiddle_right{
      
    width:400px;
      
    height45px;
      
    float:left;

    }

    form{
      
    widthauto;
      
    height38px;
      
    text-align:center
      
    background-color:#000000;

    }

    input{
      
    line-height25px;
      
    font-size18px;
      
    height30px;
      
    width195px;;
     
    }

    #headerbottom{
      
    width:1020px;
      
    height45px;
      
    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-top7px solid #0A0A0A;
      
    border-right5px solid #948F91;
      
    border-bottom6px solid #A89D9F;
      
    border-left5px 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 /></divpage 1 of 1--    <class="mypage" href='/search_pinboard/search_pinboard.php?pagenum=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 Marys double date for charity<br />
    <
    br />
    Lazy extreme:Wifes 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 Marys double date for charityLazy extreme:Wifes 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

  • #8
    Regular Coder
    Join Date
    Dec 2006
    Posts
    306
    Thanks
    24
    Thanked 0 Times in 0 Posts
    when i post above souce code to W3, it has not problem at all. so i may be ignore it.

    Thanks a lot


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •