Web Development Basics

With proper use of the ASP 3.0 object model, you can generically display all of the information that was posted by any HTML form. The following code, written in VBScript, will display all of the form variables submitted.

Example:

<P><STRONG>Form Collection</STRONG> </P> <P>

For Each Item in Request.Form

For intLoop = 1 to Request.Form(Item).Count

Response.Write Item & 11 = 11 & Request.Form(Item)(intLoop)

^jjGenericTemplate.asp - Notepad

File | Edit Format Help

New Ctrl+N

Save Ctrl+5

File | Edit Format Help

New Ctrl+N

Save Ctrl+5

I_aspx Zj „private vti_cnf _J_vti_loq _vtl_pvt _vti_script _vti_txt Ij images

File name: | R eceiveCornmentî. asp"

I_aspx Zj „private vti_cnf _J_vti_loq _vtl_pvt _vti_script _vti_txt Ij images

File name: | R eceiveCornmentî. asp"

Save as type: jîext Documen Encoding: |aNSI

Click File O Save As.

b— Click to select the Default Web Site folder where you want to store your file.

-■ If the Default Web Site folder is not onscreen, click the Save in 0to select the folder.

"31

jJjsJ

Type ReceiveComments.asp as your filename.

Click Save to save and close the dialog box.

Note: You will need to copy SubmitComments.htm to C:\InetPub\wwwroot\ from the installation directory or the CD.

"ffl Browse to the saved Web page at http://localhost /SubmitComments.htm.

Note: See page 20 for instructions on browsing the default Web site.

-M The Web page appears with the form on it.

Type your information into the fields on the form.

Click the Send Comments button.

■ The Web page echoes back the information that you filled in on the form.

Was this article helpful?

0 0

Post a comment