Microsoft Knowledge Base Email Alertz

KBAlertz.com: (180824) - Microsoft FrontPage includes a Save Results Form Handler that you can use to save information submitted from a form to a text file. You can also use Active Server Pages (ASP) to save submitted information to a file. This might be desirable if the...

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]

Search KbAlertz

Advanced Search

Webmasters
Put kbAlertz on your website.
[ Click Here for more! ]





ASP.NET 3.5 Web Hosting with Windows 2008 and SQL 2008: Click Here!
Discount ASP.NET Hosting
ASP.NET 2.0 and 3.5
Windows2008 and SQL2008
US and UK Hosting
The ad says 3 - but KBAlertz referrals get
** SIX MONTHS FREE **


Bug Tracking Software
For bug tracking software or defect tracking software or issue tracking software, visit Axosoft.


Community Site



We Send hundreds of thousands of emails using ASP.NET Email



Expert Web Design & Graphic Design
Design44.com

ASP.NET 3.5 Web Hosting with Windows 2008 and SQL 2008: Click Here!
Discount ASP.NET Hosting
ASP.NET 2.0 and 3.5
Windows2008 and SQL2008
US and UK Hosting
The ad says 3 - but KBAlertz referrals get
** SIX MONTHS FREE **




Mentioned In








Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks




Article ID: 180824 - Last Review: December 1, 2000 - Revision: 1.0

FP98: How to Use Active Server Pages to Calculate Form Results

This article was previously published under Q180824

SUMMARY

Microsoft FrontPage includes a Save Results Form Handler that you can use to save information submitted from a form to a text file. You can also use Active Server Pages (ASP) to save submitted information to a file. This might be desirable if the FrontPage Server Extensions are not installed on the server or if calculations, such as computing sales tax, need to be performed on the submitted data.

MORE INFORMATION

Before you can use ASP, you must install the ASP engine on the Web server. The ASP engine can be found in the \60 Minute Intranet Kit\60 Minute Intranet Kit\Modules folder on the FrontPage 98 compact disc.

For more information about installing ASP, please see the following article in the Microsoft Knowledge Base:
174185  (http://kbalertz.com/Feedback.aspx?kbNumber=174185/EN-US/ ) FP98: ASP Code Displayed in Browser
To use Active Server Pages to save the results of a form to a text file, follow these steps:

  1. On the Windows Start menu, point to Programs, and click Windows Explorer. In Windows Explorer, create a folder on the C: drive called "public" (without the quotation marks).
  2. Start FrontPage Explorer. Open or create a new FrontPage Web. To do this, point to New on the File menu, and then click FrontPage Web.
  3. Create a folder in FrontPage Explorer. To do this, follow these steps: a. On the View menu, click Folders. b. On the File menu, point to New, and click Folders. c. Name the folder "Scripts" (without the quotation marks).
  4. Right-click the Scripts folder and click Properties on the menu that appears.
  5. In the Properties dialog box, click "Allow scripts or programs to be run," and then click OK.
  6. On the Tools menu, click Show FrontPage Editor.
  7. Click the HTML tab at the bottom of the window and then enter the following Microsoft Visual Basic Scripting Edition (VBScript) code between the <body> and </body> tags. NOTE: The FileSystemObjects constants are required in order for this example to work.
    
    
          <H3> Thank you for submitting your information </H3>
          <%
          '-----------------------------------------------------
          ' FileSystemObject constants include file for VBScript
          '-----------------------------------------------------
    
          '---- iomode Values ----
          Const ForAppending = 8
          Const ForReading = 1
          Const ForWriting = 2
    
          '---- format Values ----
          Const TristateFalse = 0
          Const TristateMixed = -2
          Const TristateTrue = -1
          Const TristateUseDefault = -2
    
          ' If the file already exists, then an error will be generated.
          ' This line permits the program to continue executing on error.
          On error Resume next
          ' Create the scripting object.
          set objfso = createobject("scripting.FileSystemObject")
    
          ' Create the text file. If the file already exists, then an error
          ' will be generated.
          set myobject = objfso.createtextfile("c:\public\myfile.txt", false)
    
         ' Open the file for scripting.  If it does not exist, setting
          ' the third parameter (Create) to true will cause it to be created
          set myobject = objfso.opentextfile ("c:\public\myfile.txt",  forappending, true )
    
          'Calculate the total price.
          quantity = request.form("quantity")
          price = request.form("price")
          totalprice = quantity * price
    
          ' Assign the submitted form results to a variable.
          productdata = request.form("name") & "," & request.form("product") &
          "," & request.form("quantity") & "," & request.form("price") & "," &
          totalprice
    
          ' Write the form results to the file.
          myobject.writeline(productdata)
    
          ' Close the object.
          myobject.close
          %>
  8. Save the file and name it "Submit.asp" (without the quotation marks). Save the file in the Scripts folder that you created in Step 3.
  9. Create the form by following these steps: a. In FrontPage Editor, create a new page. To do this, click New on the File menu, click the Page tab, select Normal Page, and click OK. b. On this page, create a form with four one-line text boxes, and insert a Submit button. To insert the form field, point to Form Field on the Insert menu and then click One-Line Text Box. NOTE: The Submit button will automatically appear the first time you insert a form field. c. Name the four text-boxes "Name," "Product," "Price," and "Quantity"(without the quotation marks) respectively. To do this, right-click a text box and then click Form Field Properties on the menu that appears. The names must match the names referred to by the Request.form statements in Step 6.
  10. Set the form to execute the ASP file (Submit.asp), by following these steps: a. Right-click the form and then click Form Properties on the menu that appears. b. Click Send To Other. c. In the Send To Other list, click "Custom ISAPI, NSAPI, CGI, or ASP Script." d. Click Options. e. In the Action box in the "Options for Custom Form Handler" dialog box, type the following: Scripts/submit.asp
  11. Save the file in the root of the Web and name it "Default.htm" (without the quotation marks).

REFERENCES

For more information about VBScript constants, please see the following article in the Microsoft Knowledge Base:
163009  (http://kbalertz.com/Feedback.aspx?kbNumber=163009/EN-US/ ) Values for Scripting Object Constants Defined

APPLIES TO
  • Microsoft FrontPage 98 Standard Edition
Keywords: 
kbhowto KB180824
Retired KB ArticleRetired KB Content Disclaimer
This article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate

Be the first to leave feedback, to help others about this knowledge base article.

(Optional) Name

(Optional) Public URL Or Email

Comments
No HTML -- Text Only Please