Skip navigation
Currently Being Moderated

php

May 7, 2012 2:27 PM

I've recently converted to includes PHP everything works OK but today I decided to validate one of my pages at site level and I found there are errors, but when I checked them on D W all the pages are OK, then I looked at the includes individually and found they all have errors, is this a problem and if so what can  I do about it, can any one help please, thank you Jeff Lane

 
Replies
  • Currently Being Moderated
    May 7, 2012 2:35 PM   in reply to Jeffrey54 Lane

    All that matters to the validator is the resultant code (as seen in browser View Source) after the includes have been processed on the server.

     

    The includes are pre-processed on the server individually then the page is stitched together from the component parts by the server to form a single valid page. Then it's delivered to the browser - and that's what the validator sees.

     

    Can you post a link to a page that concerns you?

     
    |
    Mark as:
  • Currently Being Moderated
    May 7, 2012 2:38 PM   in reply to Jeffrey54 Lane

    Nobody can help unless you say what the errors are.

     

    Are they PHP errors?

    Are they W3C validation errors?

     

    Without seeing the site you're talking about, you're simply asking others to take part in a game of guesswork.

     
    |
    Mark as:
  • Currently Being Moderated
    May 7, 2012 2:39 PM   in reply to Jeffrey54 Lane

    Include files should only contain snippets of relevant code. 

     

    Example include for a menu.

     

    <div id="menu">

    <ul>

         <li>menu item</li>

         <li>menu item</li>

         <li>menu item</li>

    </ul>

    </div>

     

    They should NOT contain tags that already occur in parent pages such as <html>, <head> or <scripts> unless you're using includes for those as well.

     

    For better answers, we would need to see your parent page code and your include code. 

     

     

    Nancy O.

    Alt-Web Design & Publishing

    Web | Graphics | Print | Media  Specialists 

    http://alt-web.com/

    http://twitter.com/altweb

    http://alt-web.blogspot.com/

     
    |
    Mark as:
  • Currently Being Moderated
    May 7, 2012 3:26 PM   in reply to Jeffrey54 Lane

    Jeffrey54 Lane wrote:

     

    I looked at the includes individually and found they all have errors, is this a problem and if so what can  I do about it

    Some "errors" are simple noncompliance with W3C standards, and others can affect page performance in some or all browsers/devices. Thus it's best to repar them.

     

    What I do is open the page from the server, and save a copy as HTML only.

    Then I run the page through the W3C validator to view the errors .

    I open the saved page in DW and repair the errors in the "include" sections of the page and save it.

    Finally, I transfer the corrections to my include file and upload it.

     
    |
    Mark as:
  • Currently Being Moderated
    May 8, 2012 10:21 AM   in reply to Jeffrey54 Lane

    Where you see the below validation error it means you have not declared - type="text/javascript" in the <script> tag.

     

    So this:

     

    <script>(function(d, s, id) {

     

    Should be:

     

    <script type="text/javascript">(function(d, s, id) {

     

     

    The rest of the errors appear to be associated with 'twitter' and 'facebook' button code so I would forget those.

     
    |
    Mark as:
  • Currently Being Moderated
    May 8, 2012 10:11 AM   in reply to Jeffrey54 Lane

    Better to validate the page as a whole.

    The W3C validator picks up 11 HTML errors on your home page.

    http://validator.w3.org/check?verbose=1&uri=http%3A%2F%2Fwww.thecarpet andflooringconsultant.co.uk%2F

     

    Most of them come from Facebook like and Twitter share buttons.

    On line 413, a misplaced </p> tag.

     

    That's about it.  No major stuff I can see.

     

     

    Nancy O.

    Alt-Web Design & Publishing

    Web | Graphics | Print | Media  Specialists 

    http://alt-web.com/

    http://twitter.com/altweb

    http://alt-web.blogspot.com/

     
    |
    Mark as:
  • Currently Being Moderated
    May 9, 2012 10:03 AM   in reply to Jeffrey54 Lane

    Don't waste time trying to validate FaceBook or Twitter code. They're proprietary junk.  If you want valid code, don't use their buttons.

     

     

    Nancy O.

     
    |
    Mark as:
  • Currently Being Moderated
    May 9, 2012 10:24 AM   in reply to Jeffrey54 Lane
     
    |
    Mark as:
  • Sudarshan Thiagarajan
    3,729 posts
    Oct 15, 2010
    Currently Being Moderated
    May 9, 2012 10:44 AM   in reply to Jeffrey54 Lane

    Nancy meant if you want valid code, dont use FB/ Twitter buttons.

     
    |
    Mark as:
  • Currently Being Moderated
    May 9, 2012 11:36 AM   in reply to Jeffrey54 Lane

    Jeffrey54 Lane wrote:

     

    W3C Validation

     

    Description: Error Line 410, Column 248: there is no attribute "data-url"

     

    …class="twitter-share-button" data-url="http://www.thecarpetandflooringconsulta…

     

    Tweet</a

     

    The problem lies with your doctype. The data-url attribute is valid in HTML5 only.

     
    |
    Mark as:
  • Currently Being Moderated
    May 10, 2012 12:08 AM   in reply to Jeffrey54 Lane

    Jeffrey54 Lane wrote:

     

    Almost all the marketing people tell you to use Facebook and twitter to enhance you marketing and make the most of it, only thing is I wouldn’t use it if I were you because their buttons are a load of crap, surely they would have picked up on this by now and done something about it, wouldn’t have they? Jeff Lane

     

    I think you're making a mountain out of a mole hill. I would not worry too much about getting your page to validate 100%, waste of production time. The errors on your page will make no difference to performace, display or anything else for that matter. The art is knowing when to move on, validation means nothing, no guarantee of anything, certainly not to be relied on as a measure of if the page will display cross-browser, not even that you have wrtten 'economical' code.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points