A List Apart has an informative article on protecting your code from cross-site scripting. What I liked about this article is that they weren’t platform or programming language specific. Fundamentals were taught leaving the user to apply the techniques to the users specific environment.
This is part one of a two part artcile.