replace function integrated into drw (Full Version)

All Forums >> [Web Development] >> ASP and Database



Message


hessfirm -> replace function integrated into drw (6/10/2008 9:38:18)

hi everyone!
anyone know how i would use a replace function and then integrate into the drw?

here's my function:

<%public function fSanitize(strText)
replace (strText, "'", "''")
replace (strText, ";", ",")
replace (strText, "(", "")
replace (strText, ")", "")
replace (strText, "=", "")
replace (strText, "xp_", "")
replace (strText, "/*", "")
replace (strText, "*/", "")
replace (strText, "--", "")
End Function%>

and here's my sample drw:
fp_sQry="SELECT * FROM view_xxx WHERE city IN (::city::) and state = '::state::'

Thanks!




DesiMcK -> RE: replace function integrated into drw (6/10/2008 15:29:14)

I assume you want to do the replace on city and state.

try something like:

mycity = fSanitize(Request("city"))

mystate = fSanitize(Request("state"))

Then

fp_sQry="SELECT * FROM view_xxx WHERE city IN (" & mycity & ") and state = '" & mystate &"'"






Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.0625