Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2005
    Location
    North-East, Indiana
    Posts
    417

    [Little Help] XHTML Validation

    Ok...

    I'm getting some errors... it's bc of PHP.

    http://validator.w3.org/check?uri=ht...Inline&group=0

    My line(s) look like this...

    PHP Code:
     <?php
            $result 
    mysql_query("SELECT * FROM links");
            while(
    $links mysql_fetch_array($result))
                  {
                    echo 
    "<div class=links><a href="; echo $links['href']; echo "> &raquo; "; echo $links[title]; echo "</a></div>";
                  }
            
    ?>
    I know it's giving me the errors because I can't put " " around my actual HTML tags...

    how can I fix this?

  2. #2
    Join Date
    Aug 2003
    Location
    California, USA
    Posts
    581
    PHP Code:
    echo '<div class="links"><a href="' $links['href'] . '">&raquo; ' $links['title'] . '</a></div>'

  3. #3
    Join Date
    Feb 2002
    Location
    New York, NY
    Posts
    4,612
    Another alternative:

    PHP Code:
    echo "<div class=\"links\"><a href=\"".$links['href']."\"> &raquo; ".$links['title']."</a></div>"
    Scott Burns, President
    BQ Internet Corporation
    Remote Rsync and FTP backup solutions
    *** http://www.bqbackup.com/ ***

  4. #4
    Join Date
    Dec 2007
    Location
    Lebanon
    Posts
    413
    yes u shouldn't get anymore errors after quoting, in all cases php has nothing to do with xhtml validation

Posting Permissions

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