Replace single quotes entered in forms (Rated 0)Description:
This handy function will replace the ' character entered into a web form, with an ascii equivalent. This is essential for posting and retrieval of single quotes to and from a database. This script is just a "snippet" - it indicates how you would incorporate the function with the request.form collection, but isnt a fully working example. Code starts here
'form variables
dim formVar
'encapsulate form element with quote replacing function
formVar = QuoteReplace(Request.Form("input"))
'function code
Function QuoteReplace(formVar)
QuoteReplace = Replace (formVar, Chr(34),""")
QuoteReplace = Replace (QuoteReplace,"'","'")
End Function
Submitted by Devscripts on 13-02-2003 20:07 |