EvoX2004 Posted April 25, 2006 Share Posted April 25, 2006 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... Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted April 25, 2006 Share Posted April 25, 2006 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! Quote Link to comment Share on other sites More sharing options...
EvoX2004 Posted April 25, 2006 Author Share Posted April 25, 2006 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... Quote Link to comment Share on other sites More sharing options...
aquaman Posted April 25, 2006 Share Posted April 25, 2006 [!--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? Quote Link to comment Share on other sites More sharing options...
AndyB Posted April 25, 2006 Share Posted April 25, 2006 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. Quote Link to comment Share on other sites More sharing options...
EvoX2004 Posted April 26, 2006 Author Share Posted April 26, 2006 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 Link to comment Share on other sites More sharing options...
Yesideez Posted April 26, 2006 Share Posted April 26, 2006 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 :( Quote Link to comment Share on other sites More sharing options...
AndyB Posted April 26, 2006 Share Posted April 26, 2006 [!--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. Quote Link to comment Share on other sites More sharing options...
EvoX2004 Posted April 27, 2006 Author Share Posted April 27, 2006 [!--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? Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted April 27, 2006 Share Posted April 27, 2006 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? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.