Two functions that make the ASP's debug simple

Source: Internet
Author: User

<%
'---------------------------------------------------------------------------
' Program function: Print all values entered by Request.Form
'---------------------------------------------------------------------------
Response.Write FormData ()
function FormData ()
Dim Llngmaxfieldindex
Dim Llngfieldindex
Dim Llngmaxvalueindex
Dim Llngvalueindex
Dim Lstrdebug
' Count Form
Llngmaxfieldindex = Request.Form.Count

' Let user know if Form does not exist
If Llngmaxfieldindex = 0 Then
FormData = "Form data is empty."
Exit function
End If

' Begin building a list of all Form
Lstrdebug = "<OL>"

' Loop through each Form
For llngfieldindex = 1 to Llngmaxfieldindex
Lstrdebug = lstrdebug & "<LI>" & Server.HTMLEncode (Request.Form.Key (Llngfieldindex))

' Count the values
Llngmaxvalueindex = Request.Form (Llngfieldindex). Count

' If the Field doesn ' t have multiple values ...
If Llngmaxvalueindex = 1 Then
Lstrdebug = lstrdebug & "="
Lstrdebug = Lstrdebug & Server.HTMLEncode (Request.Form.Item (Llngfieldindex))
' Else Loop through each value
Else
Lstrdebug = lstrdebug & "<OL>"
For llngvalueindex = 1 to Llngmaxvalueindex
Lstrdebug = lstrdebug & "<LI>"
Lstrdebug = Lstrdebug & Server.HTMLEncode (Request.Form (Llngfieldindex) (Llngvalueindex))
Lstrdebug = lstrdebug & "</LI>"
Next
Lstrdebug = lstrdebug & "</OL>"
End If
Lstrdebug = lstrdebug & "</LI>"
Next
Lstrdebug = lstrdebug & "</OL>"
' Return the data
FormData = Lstrdebug

End Function

%>

<%
'-------------------------------------------------------------------------
' function function: output all input request.querystring values, for debugging!
'-------------------------------------------------------------------------

Response.Write Querystringdata ()
function Querystringdata ()
Dim Llngmaxfieldindex
Dim Llngfieldindex
Dim Llngmaxvalueindex
Dim Llngvalueindex
Dim Lstrdebug
' Count querystring
Llngmaxfieldindex = Request.QueryString.Count

' Let user know if QueryString does not exist
If Llngmaxfieldindex = 0 Then
Querystringdata = "QueryString data is empty."
Exit function
End If

' Begin building a list of all QueryString
Lstrdebug = "<OL>"

' Loop through each querystring
For llngfieldindex = 1 to Llngmaxfieldindex
Lstrdebug = lstrdebug & "<LI>" & Server.HTMLEncode (Request.QueryString.Key (Llngfieldindex))

' Count the values
Llngmaxvalueindex = Request.QueryString (Llngfieldindex). Count

' If the Field doesn ' t have multiple values ...
If Llngmaxvalueindex = 1 Then
Lstrdebug = lstrdebug & "="
Lstrdebug = Lstrdebug & Server.HTMLEncode (Request.QueryString.Item (Llngfieldindex))
' Else Loop through each value
Else
Lstrdebug = lstrdebug & "<OL>"
For llngvalueindex = 1 to Llngmaxvalueindex
Lstrdebug = lstrdebug & "<LI>"
Lstrdebug = Lstrdebug & Server.HTMLEncode (Request.QueryString (Llngfieldindex) (Llngvalueindex))
Lstrdebug = lstrdebug & "</LI>"
Next
Lstrdebug = lstrdebug & "</OL>"
End If
Lstrdebug = lstrdebug & "</LI>"
Next
Lstrdebug = lstrdebug & "</OL>"
' Return the data
Querystringdata = Lstrdebug

End Function

%>



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.