Strict 1.0 Failed validation, 132 Errors

Discussion in 'PHP' started by yorsite, Jan 24, 2008.

  1. #1
    Hi,

    Can someone tell me how to fix a problem I am having (I am a newbie to PHP):

    :confused: I am working on http://journalaccess.com and I am coming accross an issue where:

    I use <?php require(); ?> to include my header however when I do this the index.php page shows the info from the header (<div class="h2"><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http:/) in the body of the index page, which shows as errors in strict 1.0 whenever I try to validate it. Should I even be using <?php require(); ?>, or should I use something else?

    Help is appreciated. And if you would like to throw in some tips that would be great too, thanks!:D
     
    yorsite, Jan 24, 2008 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    There's nothing wrong with using require(), you just have to restructure your site so that it appears as it should. We can't help you with that, with the bit of code you gave us.

    Perhaps it's easier for you if you use more separate files. You can use as many require()s as you want.
     
    nico_swd, Jan 25, 2008 IP
  3. krzyk

    krzyk Peon

    Messages:
    61
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Why do you have <div class="h2"> in your header?
    Or maybe it's in the index.php, before the code that calls require(), if so then remove it, the header is the full header. Or change it in such way that the DOCTYPE is stored in index.php and then require() a header file which contains only the rest (head, html, body).
     
    krzyk, Jan 25, 2008 IP
  4. kmap

    kmap Well-Known Member

    Messages:
    2,215
    Likes Received:
    29
    Best Answers:
    2
    Trophy Points:
    135
    #4
    its very hard to validate a page or make a page without having errors if you are using php as the code is broken in many files.There are many rules ,tags, and attributes which fails validation.To me best posible thing before you know php you should know html and css first because without that you will allways have problems

    Regards

    Alex
     
    kmap, Jan 25, 2008 IP