bulgarian388
12-18-2006, 02:38 PM
Hi guys, I am trying to create an ASP file that generates and outputs XML code to the browser. I am trying to make a password comparison via XMLHttpRequest(), and get the results from the asp page. Problem is that the code is working, it is outputting the file structure I expect it to, but Firefox says it's invalid markup, and also it doesn't display like other pure XML documents I have. Here is the code I am using:
response.Expires = 0
response.ExpiresAbsolute = now() - 1
response.AddHeader "pragma","no-cache"
response.AddHeader "cache-control","private"
response.CacheControl = "no-cache"
keyId = session("keyId")
sessionName = session("sessionName")
sessionLevel = session("sessionLevel")
'if keyId = "" or isnull(keyId) then
' response.Redirect("../")
'end if
currentPassword = request.QueryString("currentPassword")
Set A = server.CreateObject("ADODB.Connection")
A.Open(" :) ")
Set A1 = A.Execute("SELECT password FROM membershipManagement WHERE keyId = '" & keyId & "'")
If Not A1.EOF Then
password = A1("password")
End If
A1.Close()
Set A1 = Nothing
A.Close()
Set A = Nothing
if currentPassword = password then
isValid = true
else
isValid = false
end if
response.Write("<?xml version=" & chr(34) & "1.0" & chr(34) & " encoding=" & chr(34) & "iso-8859-1" & chr(34) & "?>" & VbCrLf)
response.Write("<results>" & VbCrLf)
response.Write(" <isValid>" & isValid & "</isValid>" & VbCrLf)
response.Write("</results>" & VbCrLf)
response.End()
And I get this as output:
<?xml version="1.0" encoding="iso-8859-1"?>
<results>
<isValid>True</isValid>
</results>
Could someone point me to the right direction, pretty please? ;) ;) ;)
Thanks in advance!
response.Expires = 0
response.ExpiresAbsolute = now() - 1
response.AddHeader "pragma","no-cache"
response.AddHeader "cache-control","private"
response.CacheControl = "no-cache"
keyId = session("keyId")
sessionName = session("sessionName")
sessionLevel = session("sessionLevel")
'if keyId = "" or isnull(keyId) then
' response.Redirect("../")
'end if
currentPassword = request.QueryString("currentPassword")
Set A = server.CreateObject("ADODB.Connection")
A.Open(" :) ")
Set A1 = A.Execute("SELECT password FROM membershipManagement WHERE keyId = '" & keyId & "'")
If Not A1.EOF Then
password = A1("password")
End If
A1.Close()
Set A1 = Nothing
A.Close()
Set A = Nothing
if currentPassword = password then
isValid = true
else
isValid = false
end if
response.Write("<?xml version=" & chr(34) & "1.0" & chr(34) & " encoding=" & chr(34) & "iso-8859-1" & chr(34) & "?>" & VbCrLf)
response.Write("<results>" & VbCrLf)
response.Write(" <isValid>" & isValid & "</isValid>" & VbCrLf)
response.Write("</results>" & VbCrLf)
response.End()
And I get this as output:
<?xml version="1.0" encoding="iso-8859-1"?>
<results>
<isValid>True</isValid>
</results>
Could someone point me to the right direction, pretty please? ;) ;) ;)
Thanks in advance!