wright67uk Posted June 26, 2011 Share Posted June 26, 2011 Although Im familiar with using validators for html and css. What in your opinion would be the best way to run my files through a validator? The validator I currently use http://validator.w3.org/ thows up 75 errors as it is looking at my php. Is it best to turn my php into an html comment for the purpose of testing the html, or is there a better way of testing my files that contain server side scripting? maybe there is a validator that ignores anything within php tags? Quote Link to comment https://forums.phpfreaks.com/topic/240469-validating-html-within-a-php-file/ Share on other sites More sharing options...
PFMaBiSmAd Posted June 26, 2011 Share Posted June 26, 2011 Your php based page is not a complete web document until the php code in it has been parsed, tokenized, interpreted, and the php code outputs the dynamically produce portions of the page. If you are doing this on a localhost development system, you would browse to the page on your localhost server and copy/paste the 'view source' from your browser into the w3.org validator. If you are doing this on a publicly accessible server, you would enter the URL of the page into the w3.org validator. Quote Link to comment https://forums.phpfreaks.com/topic/240469-validating-html-within-a-php-file/#findComment-1235144 Share on other sites More sharing options...
Pikachu2000 Posted June 26, 2011 Share Posted June 26, 2011 Alternately, if you're using FF with the web developer tools installed, you should have a "Validate Local HTML" option in the Tools ---> Web Developer ---> Tools menu (or Command-Shift-A on Mac OS). Quote Link to comment https://forums.phpfreaks.com/topic/240469-validating-html-within-a-php-file/#findComment-1235166 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.