Jump to content

W3C Validation


EvoX2004

Recommended Posts

ok so I'm very newb at php... i actually learned a little of it by going through this pages that I have to optimize for work and I also have to validate them through the W3C validator. I just need help on why through the validator it gives this error and highlights < in red... "unclosed start-tag requires SHORTTAG YES."

i would greatly appreciate it if anyone knows how to fix this problem...
Link to comment
Share on other sites

no im passing the HTML file through the validator... there is php code in the html file... and so the validator picks up the php and gives me the error on my previous for majority of the php code writtten and meshed in the html code...
Link to comment
Share on other sites

[!--quoteo(post=368561:date=Apr 25 2006, 02:10 PM:name=EvoX)--][div class=\'quotetop\']QUOTE(EvoX @ Apr 25 2006, 02:10 PM) [snapback]368561[/snapback][/div][div class=\'quotemain\'][!--quotec--]
there is php code in the html file.
[/quote]

how can there be PHP in the html code that is being generated?
Link to comment
Share on other sites

If you have 'unclosed short tag' errors, it means that the html standard against which you are validating does not support the method used in your (html) code for closing tags .... for example <br/>, <img ..../>, <meta ...../> etc. will validate against the right doctype/standard whereas <meta ....> will fail. That should point you in the right direction.
Link to comment
Share on other sites

I know its a bit naughty but not all of my sites are W3C compliant but the ones that are, all pages can be checked regardless of whether they're created using PHP or plain HTML.

I've found that the W3C validator will still check and validate code best when its online and not uploaded. That way if the site is written using PHP the result will be HTML and thats whats checked.

If your site has a command line that has to be parsed via the URL then online validators will still parse this and generate the HTML depending on the URL contents.

Plese forgive me for wording this badly if its difficult to read but its extremely hot here at work and I can't open the doors and windows more than they already are :(
Link to comment
Share on other sites

[!--quoteo(post=368844:date=Apr 26 2006, 10:29 AM:name=EvoX)--][div class=\'quotetop\']QUOTE(EvoX @ Apr 26 2006, 10:29 AM) [snapback]368844[/snapback][/div][div class=\'quotemain\'][!--quotec--]but its not highlighting any HTML code.. its highlighting all the PHP code brackets and the php code is close correctly with <? and then ?> correct?[/quote]
Are you trying to validate php code using the W3C validator? It will not work. The W3C validator validates html not some mixrure of html and php.
Link to comment
Share on other sites

[!--quoteo(post=368885:date=Apr 26 2006, 11:13 AM:name=AndyB)--][div class=\'quotetop\']QUOTE(AndyB @ Apr 26 2006, 11:13 AM) [snapback]368885[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Are you trying to validate php code using the W3C validator? It will not work. The W3C validator validates html not some mixrure of html and php.
[/quote]



ok... so is there a way to validate both at the same time? or its not possible at all?
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.