最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
Displaying All of the Form Variables
时间:2022-06-30 09:49:11 编辑:袖梨 来源:一聚教程网
When debugging ASP pages it can be very useful to see exactly what data is being sent when a form is posted. For that reason, I decided to create a handy little function that will display all of the form variable names and values. This function, FormDataDump() has the following definition:
Sub FormDataDump(bolShowOutput, bolEndPageExecution)
These two input parameters are Boolean values. bolShowOutput, if True, will dump out the form field names and values for all to see. This has the effect of making your HTML page uglier and harder to read - therefore, if you are testing on a live site, you should set this value to False, in which case the form field names and values will be outputted inside of an HTML comment tag (), so that they can only be seen via a View/Source.
The second parameter, bolEndPageExecution, determines whether or not a Response.End is issued in the FormDataDump() function. Response.End, if issued, ends the processing of the ASP page.
Below you will find the complete code for the FormDataDump() function.
Sub FormDataDump(bolShowOutput, bolEndPageExecution)
Dim sItem
'What linebreak character do we need to use?
Dim strLineBreak
If bolShowOutput then
'We are showing the output, so set the line break character
'to the HTML line breaking character
strLineBreak = "
"
Else
'We are nesting the data dump in an HTML comment block, so
'use the carraige return instead of
'Also start the HTML comment block
strLineBreak = vbCrLf
Response.Write("
Sub FormDataDump(bolShowOutput, bolEndPageExecution)
These two input parameters are Boolean values. bolShowOutput, if True, will dump out the form field names and values for all to see. This has the effect of making your HTML page uglier and harder to read - therefore, if you are testing on a live site, you should set this value to False, in which case the form field names and values will be outputted inside of an HTML comment tag (), so that they can only be seen via a View/Source.
The second parameter, bolEndPageExecution, determines whether or not a Response.End is issued in the FormDataDump() function. Response.End, if issued, ends the processing of the ASP page.
Below you will find the complete code for the FormDataDump() function.
Sub FormDataDump(bolShowOutput, bolEndPageExecution)
Dim sItem
'What linebreak character do we need to use?
Dim strLineBreak
If bolShowOutput then
'We are showing the output, so set the line break character
'to the HTML line breaking character
strLineBreak = "
"
Else
'We are nesting the data dump in an HTML comment block, so
'use the carraige return instead of
'Also start the HTML comment block
strLineBreak = vbCrLf
Response.Write("