Valhalla Legends Archive

Programming => Web Development => Topic started by: Grok on October 14, 2003, 10:45 AM

Title: Attn: Spht
Post by: Grok on October 14, 2003, 10:45 AM
Spht, we should be using HTMLEncode for saving the news body to file.

This example accepts information entered by a user in a Web page and encodes it so that HTML characters are converted into a displayable, non-executable format. For example, it converts the string:

<A HREF="http://www.microsoft.com">Home</A>
into the string:

&lt;A HREF=&quot;http://www.microsoft.com&quot;&gt;Home&lt;/A&gt;
Example
Private Sub Button1_Click(ByVal sender As System.Object, _
       ByVal e As System.EventArgs) Handles Button1.Click
   Label1.Text = Server.HtmlEncode(TextBox1.Text)
End Sub
Title: Re:Attn: Spht
Post by: Spht on October 14, 2003, 12:59 PM
Done. I had that guy forgotten about.