Jump to content

Archived

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

EvoX2004

W3C Validation

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...

Share this post


Link to post
Share on other sites
Are you passin the source code of the php file to teh validator or the output generated by the script?

You should only pass teh latter!

Share this post


Link to post
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...

Share this post


Link to post
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?

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
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 :(

Share this post


Link to post
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.

Share this post


Link to post
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?

Share this post


Link to post
Share on other sites
The W3C Validator only validates HTML and CSS. You cannot validate your PHP code as there is no set standard to PHP. However HTML and CSS do the people that set the standards are W3C.

Why are you trying to validate your PHP?

Share this post


Link to post
Share on other sites

×

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.