ASP修改代码里replace的用法看不懂了
这是一个修改通知写入数据库的代码的一部分<%IfRequest.Form("Overskrift")=""ThenResponse.Redirect"admin_add....
这是一个修改通知写入数据库的代码的一部分
<%
If Request.Form("Overskrift") = "" Then Response.Redirect "admin_add.asp?status=title"
If Request.Form("YOUR_CONTENT") = "" Then Response.Redirect "admin_add.asp?status=textfield"
Set Con = Server.CreateObject("ADODB.Connection")
Set rsQuery = Server.CreateObject("ADODB.Recordset")
Path = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="
Path = Path & DataBasePath
Con.Open Path
Header = Request.Form("Overskrift")
Header = Replace(Header, Chr(39), "@Chr(39)@")
Header = Replace(Header, Chr(34), "@Chr(34)@")
Msg = Request.Form("YOUR_CONTENT")
Msg = Replace(Msg, Chr(39), "@Chr(39)@")
Msg = Replace(Msg, Chr(34), "@Chr(34)@")
If Session("Level") > 1 Then
SQLstmt = "INSERT INTO msgdb (Username,Header,Message,Posted,Pagename,Validated)"
SQLstmt = SQLstmt & " VALUES ("
SQLstmt = SQLstmt & "'" & Session("User") & "',"
SQLstmt = SQLstmt & "'" & Header & "',"
SQLstmt = SQLstmt & "'" & Msg & "',"
SQLstmt = SQLstmt & "'" & Date & "',"
SQLstmt = SQLstmt & "'" & Request.Form("txtpage") & "',"
SQLstmt = SQLstmt & "True"
SQLstmt = SQLstmt & ")"
End If
看不懂啊,里面的"@Chr(34)@"是什么意思啊,不会是把'替换成@'@吧??!! 展开
<%
If Request.Form("Overskrift") = "" Then Response.Redirect "admin_add.asp?status=title"
If Request.Form("YOUR_CONTENT") = "" Then Response.Redirect "admin_add.asp?status=textfield"
Set Con = Server.CreateObject("ADODB.Connection")
Set rsQuery = Server.CreateObject("ADODB.Recordset")
Path = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="
Path = Path & DataBasePath
Con.Open Path
Header = Request.Form("Overskrift")
Header = Replace(Header, Chr(39), "@Chr(39)@")
Header = Replace(Header, Chr(34), "@Chr(34)@")
Msg = Request.Form("YOUR_CONTENT")
Msg = Replace(Msg, Chr(39), "@Chr(39)@")
Msg = Replace(Msg, Chr(34), "@Chr(34)@")
If Session("Level") > 1 Then
SQLstmt = "INSERT INTO msgdb (Username,Header,Message,Posted,Pagename,Validated)"
SQLstmt = SQLstmt & " VALUES ("
SQLstmt = SQLstmt & "'" & Session("User") & "',"
SQLstmt = SQLstmt & "'" & Header & "',"
SQLstmt = SQLstmt & "'" & Msg & "',"
SQLstmt = SQLstmt & "'" & Date & "',"
SQLstmt = SQLstmt & "'" & Request.Form("txtpage") & "',"
SQLstmt = SQLstmt & "True"
SQLstmt = SQLstmt & ")"
End If
看不懂啊,里面的"@Chr(34)@"是什么意思啊,不会是把'替换成@'@吧??!! 展开
3个回答
展开全部
你说的对,但是我看不明白他是什么意思,我觉得应该把单引号chr(39) replace成空白的或转义
Msg = Replace(Msg, Chr(39), "")
Msg = Replace(Msg, Chr(39), "[']")
Msg = Replace(Msg, Chr(39), "")
Msg = Replace(Msg, Chr(39), "[']")
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
<%
response.write("abc:" & chr(34))
%>
显示的是一个双引号。
response.write("abc:" & chr(34))
%>
显示的是一个双引号。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询