An excellent example of what happens on beginners help forums where the blind get to lead the blind.
Of course, it's an easy mistake to make :(
And towards the end of that CGI101 discussion, notice the examples of a bbs system being too broken to accept reasonable HTML!
The question is not how do I use a loop to escape all these html chars, it's why arn't I using the escapeHTML function to do it.