Basic ASP field validation

Are you looking for an ASP function that pre-processes input values from forms?

<%
Function Fix_Vals(Input_Var)
	Input_Var = Trim(Input_Var) 'Get rid of excess spaces
	Input_Var = Replace(Input_Var, "<", "&lt;")
	Input_Var = Replace(Input_Var, ">", "&gt;")
	Input_Var = Replace(Input_Var, "'", "''")
	Input_Var = Replace(Input_Var, "(", "")
	Input_Var = Replace(Input_Var, ")", "")
	Input_Var = Replace(Input_Var, """, "")
	Input_Var = Replace(Input_Var, "../", "")
	Input_Var = Replace(Input_Var, "UNION", "")
	Input_Var = Replace(Input_Var, "alert", "")
	Input_Var = Replace(Input_Var, "javascript", "")
	Fix_Vals = Input_Var
End Function
%>
Share this