jusmeig:
and in theory I need to stop them posting to a public login form.
Hi
What about giving him a warning when you receive this kind of unsafe scripting?
Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
Dim objErr As Exception = Server.GetLastError().GetBaseException()
If objErr.Message.Contains("A potentially dangerous Request.Form value was detected from the client") Then
Dim userip As String = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
If userip = "" Then userip = Request.ServerVariables("REMOTE_ADDR")
Response.Write("Hei,I know you." + userip)
End If
Server.ClearError()
' Code that runs when an unhandled error occurs
End Sub
BTW, it is good method to HTML-encode information that will be stored in HTML.
For example, It replaces '<' or ‘>' with their corresponding HTML encoded representation ‘<' and ‘>'