Where does the data go?

Results 1 to 3 of 3

Thread: Where does the data go?

  1. #1
    Join Date
    Dec 1969

    Default Where does the data go?

    I know this has got to be the dumbest ? you&#039ve ever received, but I&#039m a beginner. I&#039m reading a book on Beginning Active Server Pages from WROX. I&#039m planning on creating an ASP form for a website that i&#039m building. Here is my question. When people enter data into my form. Where does it go after they press submit? Ex: I&#039ve made a form gathering first name, last name and when they press submit it go to a confirmation page saying thank your form has been submitted, but where does the data go?<BR><BR>Sorry but I&#039m a beginner

  2. #2
    Join Date
    Dec 1969

    Default RE: Where does the data go?

    It is held in the Request object.<BR><BR>If you need to access any form element from the submitted form use this syntax:<BR>MyVar = Request.Form("PreviousFormControlNameHere")<BR><BR >

  3. #3
    Tom Levesque Guest

    Default RE: Where does the data go?

    If this is a simplified version of your form:<BR><BR>&#060;form method="POST" action="formhandler.asp"&#062;<BR><BR>&#060;p&#062 ;Your name: &#060;input name="name" type="text"&#062;&#060;/p&#062;<BR><BR>&#060;/form&#062;<BR><BR>You&#039ll notice several things: When they hit the "submit" button, the data "goes" to whatever page or script is listed under action="" In this case, formhandler.asp. The data is accessible, from that page, in several ways. Using Active Server Pages or ASPs you could access the "name" field from above like this:<BR><BR>--- formhandler.asp ---<BR>&#060;%<BR>Dim name<BR><BR>name = Request.Form("name")<BR><BR>Response.Write("The name you entered into the form was: " & name)<BR><BR>%&#062;<BR><BR>Now, "Request.Form()" grabs form values when the METHOD is equal to "POST". If the method were "GET" then it would be stored in a QueryString(not a great idea) and you would access the form values like this:<BR><BR>Request.QueryString("name")<BR><BR>&# 039 note that the "name" corresponds to the name="name" you assigned to the &#060;input&#062; tag inside your form. Each element inside a form needs a unique name so you can access individual elements&#039 values on the page the form is submitted to (action="")<BR><BR>I hope this clarifies things for you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts