...

View Full Version : Validating Server-Side Script Pages



whizard
11-25-2005, 04:17 PM
I was wondering if anyone knows how to validate a page when it is written in PHP? (I know that there's no "PHP Validator"; I want to know how to validate the HTML output from the PHP page.) My whole site is written in PHP and uses many files to put together on page. Of course, I can validate the final output code that is generated, but then I have to go back when there is an error, find which file it is in, and change that. That method is also much more work-intensive. I'm Lazy. I want to be able to type the URL in to the validator, instead of pasting the source code each time

Any comments are apreciated

Dan

_Aerospace_Eng_
11-25-2005, 04:37 PM
Then type the url, the validator should get the parsed version. Quit being lazy, web design isn't a job you can be lazy in.

whizard
11-25-2005, 04:42 PM
Thanks. That worked. I could've sworn I'd tryed that, but I guess I didn't. I was only kidding about the "being lazy". I do enjoy solving all the quirks and problems that come with web design.

Dan

PS I also have one more question. I do not use Javascript that much, so this has never arisen before. The Validator is giving me lots of errors related to the javascript coding I have. How can i make the validator ignore the javascript?

_Aerospace_Eng_
11-25-2005, 04:53 PM
Use proper comments. In XHTML you need to use a certain type of comment for embedded javascript or you could just put the JS in an external JS file and use the src attribute to reference it in the script tags.

whizard
11-25-2005, 05:10 PM
Thanks for all your input!

I assume by "special comments" you mean putting this after the script tag: <![CDATA[
and this before the /script tag: ]]>

Dan

whizard
11-25-2005, 05:13 PM
YES! Validation achieved... The sweet feel of success...

Thanks Aero for everthing

Dan

_Aerospace_Eng_
11-25-2005, 05:14 PM
<script type="text/javascript">
//<![CDATA[
Your script
//]]>
</script>

whizard
11-25-2005, 05:16 PM
Yeah, I got that. Thanks for steering me in the right direction on this.

Dan



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum