Onclick-syntax-problem bei der übergabe von zwei Variablen, classic asp

Mein onclick-Funktion funktioniert wunderbar, wenn ich übergeben Sie eine variable und nicht Antworten, sobald ich versuche zwei Variablen. ist etwas falsch mit meinem syntax?

alles unterstützt wird dieser code wurde getestet und funktioniert einwandfrei also ich bin mir sicher, etwas ist falsch mit der syntax der onclick-code-Zeile. jede Hilfe wäre genial.

------------onclick code---------------------------------------------------
    Response.Write "<td class=""alt""><input type=""button"" onclick=""deleteRecordAtt(" & AttID &","& StoredPath & " )"" value=""remove"" /></td></tr>"

-----------function reference code in main page---------------------------------------

function deleteRecordAtt(AttID, StoredPath){
if(confirm("This will delect the attachment path"))
{
document.location.href="delete_attachments.asp?EMAIL_LETTERS_HOLD_ID="+AttID+"&RedirURL="+escape(document.location.href);
}
}
-----------function code in source page ----------------------------------------------

<%


Dim AttID, RedirectURL, StoredPath
Dim objConn

AttID=request("EMAIL_LETTERS_HOLD_ID")
RedirectURL=request("RedirURL")


Set objConn = CreateObject("ADODB.Connection")
objConn.Open "DSN=MyDSN"
objConn.Execute("UPDATE EMAIL_SEND_ATTACHMENTS set ATTACHMENTS = Replace(LTRIM(RTRIM(ATTACHMENTS)), '"& StoredPath & "' ,'') WHERE EMAIL_LETTERS_HOLD_ID= "& AttID & " ")
objConn.Close
Set objConn = Nothing

response.redirect RedirectURL
%>
  • Kann StoredPath doppelte Anführungszeichen enthalten? Kannst du die HTML-diese produziert?
  • dieser code ist anfällig für sql-injection
InformationsquelleAutor MG. | 2009-01-19
Schreibe einen Kommentar