ghell
12-13-2004, 12:37 PM
when i just do Response.Write Reqest.Form it enters spaces as + and semicolons as %3B and ' and " as %27 and %22 etc.. is there any way to quickly get everything back to ; ' " etc (i tried server.urlencode() and server.htmlencode() but neither do it
i suppose i could probably do a for each loop and just write it to a string (eg Request.Form("field1") comes out as "hello everyone" but in request.form it comes out as field1=hello+everyone so maby
Function URLDecode(strRawFormData)
For Each frmField in strRawFormData
URLDecode = URLDecode & frmField & "=" & strRawFormData(frmField) & "&"
Next
URLDecode = Left(URLDecode, Len(URLDecode)-1)
End Function
Response.Write "Raw Request.Form = " & Request.Form & "<br>"
Response.Write "New Request.Form = " & URLDecode(Request.Form)
'Returns a result like this:
'Raw Request.Form = field1=hello+everyone%2C&field2=how+are+you+doing+today%3F
'New Request.Form = field1=hello everyone,&field2=how are you doing today?
but i dont know if its the best way of doing this (obvisouly a built in function would be better than a loop)
i suppose i could probably do a for each loop and just write it to a string (eg Request.Form("field1") comes out as "hello everyone" but in request.form it comes out as field1=hello+everyone so maby
Function URLDecode(strRawFormData)
For Each frmField in strRawFormData
URLDecode = URLDecode & frmField & "=" & strRawFormData(frmField) & "&"
Next
URLDecode = Left(URLDecode, Len(URLDecode)-1)
End Function
Response.Write "Raw Request.Form = " & Request.Form & "<br>"
Response.Write "New Request.Form = " & URLDecode(Request.Form)
'Returns a result like this:
'Raw Request.Form = field1=hello+everyone%2C&field2=how+are+you+doing+today%3F
'New Request.Form = field1=hello everyone,&field2=how are you doing today?
but i dont know if its the best way of doing this (obvisouly a built in function would be better than a loop)