Is there a VBScript/ASP that works like mysql_real_escape_string()???
| SitePoint Sponsor |
Is there a VBScript/ASP that works like mysql_real_escape_string()???
Have you checked the Funky Functions Thread?
http://www.sitepoint.com/forums/show...nctions-in-ASP
Andrew Wasson | www.lunadesign.org
Principal / Internet Development
Thanks.I'm gonna work on it.
I tried this code and it works.
<%
Dim MyVariable, SQL
MyVariable="My name is Michael, I'm a developer"
MyVariable =Replace(MyVariable,"'","''")
SQL = "INSERT INTO TableName(TablefieldName) VALUES ('" & MyVariable & "')"
%>
I like using this one called clean quotes because it's pretty thorough: http://www.sitepoint.com/forums/show...ape#post312576
Also here's a little library of PHP-like functions: http://www.sitepoint.com/forums/show...an#post1980880
Andrew Wasson | www.lunadesign.org
Principal / Internet Development
I can't apply those funky functions to my page.
Here you go. This is from the second link.
<%
function AddSlashes(str)
AddSlashes = replace(str,"'","''")
end function
Dim MyVariable, SQL
MyVariable="My name is Michael, I'm a developer"
MyVariable =AddSlashes(MyVariable)
SQL = "INSERT INTO TableName(TablefieldName) VALUES ('" & MyVariable & "')"
%>
Andrew Wasson | www.lunadesign.org
Principal / Internet Development
How about html tags?for example, I'm going to insert <html>,it will be added on my database ,but doesn't show on my asp page,unless you view the source.
Bookmarks