Jump to content

W3c Validator Returns Error


Redroest

Recommended Posts

Hey people. I want to get my website up into the google ranks. For this I do the following-Making all links available outside to google crawlers by using javascript/ajax as secondary navigation-Provide my website with constantly updating content-Linking from quality websitesOne of the important things is for google is making the website W3C validated and that is on ###### of a task!! I started with a standerd phpnuke CMS and upgraded it into my own system with many, many modules. First of all It is very timeconsuming running these files with the validator (http://validator.w3.org/) I also googled on the php tidy function but it doesn't read the entire website. It does send me the line on wich the error occurs but only from one file in stead of the whole website. (I am having like 2400 files including php, javascript, css and html when I include all of my modules)I have decided to start doing everything manually anyway. But now I stumbled on the following error: Parsing Error: EntityRef: expecting ';'. It happens on the line below and I can't figure out what is wrong:$content = '<form action="modules.php?name=Your_Account" OnSubmit="this.submit.disabled=true" method="POST">';I am using the <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"'."\n".' "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> format.

Link to comment
Share on other sites

Remember that the W3C validator views the final generated HTML source code of your webpage, not the server-side PHP script that generates it, so the final line the error is actually on is probably not the posted line.Also, you should really use a strict DOCTYPE.Do you have a link to your website?

Link to comment
Share on other sites

@IngolmeWell, my system is www.vvmonnickendam.nl. This is a soccer website based on a ravennuke version. The url's in this system have something like: www.vvmonnickendam.nl/modules.php?name=guestbook&op=SendMessage. So does this mean that the & in the url also has to be converted? @SynookI know that it will only scan the clientside xhtml, but is there some tool or php class wich allows me to scan the output of all pages that exist on the website and returns the phpline that outputs that xhtml error? Just so that it returns for example:

// W3C validator gives error when the alt value of <img> doesn't exist//Lets use echo '<img src="images/'.$image.'.gif" />' and it will output something like[b]error on line[/b] "30" [b]in[/b] "modules/guestbook/index.php"[b]:[/b] image tags must contain ALT values!

I know that this maybe is something for the serverside section of the forum, but since it has to do with markup...

Link to comment
Share on other sites

Well, not really, because there's no way of the validator knowing what your PHP resolves to, without actually running it. For example, how does it know that line doesn't end up as:

<img src="images/image.gif" alt="this is a .gif" />

Link to comment
Share on other sites

@IngolmeWell, my system is www.vvmonnickendam.nl. This is a soccer website based on a ravennuke version. The url's in this system have something like: www.vvmonnickendam.nl/modules.php?name=guestbook&op=SendMessage. So does this mean that the & in the url also has to be converted?
Yes, every single & must be changed to &amp; unless it is referencing a character entity.Don't worry, your URLs will still work perfectly, the browsers parse the entities into the characters they're supposed to be.
Link to comment
Share on other sites

Archived

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

×
×
  • Create New...