473,289 Members | 2,089 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,289 software developers and data experts.

Displaying Form Data on a Confirmation Page

Hi

I am using ASP and HTML to process a form. The first form calls another page to process the data. When the page processes it redirects to a page confirming submission. I want to display the data entered by the user on the confirmation page.

Could someone shed any light on how to link the pages and do this. All I can find out about is displaying information that is inserted into a database which is not relevant.

This is the code to process my form...
Expand|Select|Wrap|Line Numbers
  1. <%@ Language=VBScript %>
  2. <%
  3. Option Explicit
  4. %>
  5. <%
  6.  
  7. ' declare variables
  8. Dim EmailFrom
  9. Dim EmailTo
  10. Dim Subject
  11. Dim Name
  12. Dim Email
  13. Dim Telephone
  14. Dim Location
  15.  
  16. ' get posted data into variables
  17. EmailFrom = Trim(Request.Form("Email")) 
  18. EmailTo = "alixcoleby@googlemail.com, " & Trim(Request.Form("Email"))
  19. Subject = "Reservation Request"
  20. Name = Trim(Request.Form("Name")) 
  21. Email = Trim(Request.Form("Email")) 
  22. Telephone = Trim(Request.Form("Telephone")) 
  23. Location = Trim(Request.Form("Location")) 
  24.  
  25. ' prepare email body text
  26. Dim Body
  27. Body = Body & "Hotel Reservation Enquiry" & VbCrLf
  28.  
  29. Body = Body & "Name: " & Name & VbCrLf
  30. Body = Body & "Email: " & Email & VbCrLf
  31. Body = Body & "Telephone: " & Telephone & VbCrLf
  32. Body = Body & "Location: " & Location & VbCrLf
  33.  
  34. ' send email 
  35. Dim mail
  36. Set mail = Server.CreateObject("CDONTS.NewMail") 
  37. mail.To = EmailTo
  38. mail.From = EmailFrom
  39. mail.Subject = Subject
  40. mail.Body = Body
  41. mail.Send 
  42.  
  43. ' redirect to success page 
  44. Response.Redirect "ok.htm"
  45. ' Response.Redirect("ok.htm" & EmailFrom)
  46. %>
Jan 7 '08 #1
1 2405
jhardman
3,406 Expert 2GB
It's easiest if you don't redirect, then at the end you can just say:
Expand|Select|Wrap|Line Numbers
  1. <%@ Language=VBScript %>
  2. <%
  3. Option Explicit
  4. %>
  5. <%
  6.  
  7. ' declare variables
  8. Dim EmailFrom
  9. Dim EmailTo
  10. Dim Subject
  11. Dim Name
  12. Dim Email
  13. Dim Telephone
  14. Dim Location
  15.  
  16. ' get posted data into variables
  17. EmailFrom = Trim(Request.Form("Email")) 
  18. EmailTo = "alixcoleby@googlemail.com, " & Trim(Request.Form("Email"))
  19. Subject = "Reservation Request"
  20. Name = Trim(Request.Form("Name")) 
  21. Email = Trim(Request.Form("Email")) 
  22. Telephone = Trim(Request.Form("Telephone")) 
  23. Location = Trim(Request.Form("Location")) 
  24.  
  25. ' prepare email body text
  26. Dim Body
  27. Body = Body & "Hotel Reservation Enquiry" & VbCrLf
  28.  
  29. Body = Body & "Name: " & Name & VbCrLf
  30. Body = Body & "Email: " & Email & VbCrLf
  31. Body = Body & "Telephone: " & Telephone & VbCrLf
  32. Body = Body & "Location: " & Location & VbCrLf
  33.  
  34. ' send email 
  35. Dim mail
  36. Set mail = Server.CreateObject("CDONTS.NewMail") 
  37. mail.To = EmailTo
  38. mail.From = EmailFrom
  39. mail.Subject = Subject
  40. mail.Body = Body
  41. mail.Send 
  42.  
  43. ' instead of redirecting to success page %>
  44. <html><head><title></title></head><body><p>Form was submitted and processed correctly.
  45.  
  46. <p>The following was submitted:<ol>
  47. <%
  48. for each x in request.form %>
  49.    <li><%=x & ": " & request(x)%></li>
  50. <%
  51. next %>
  52. </ol>
  53. The data was emailed to a responsible person who will now share your secrets with the entire world wide web.
  54. </body>
Otherwise you can save the data as session variables before you redirect
Expand|Select|Wrap|Line Numbers
  1. session("emailFrom") = EmailFrom
then on the confirmation page you can pull them up
Expand|Select|Wrap|Line Numbers
  1. <p>Email address: <%=session("emailFrom")%>
Let me kow if this helps.

Jared
Jan 8 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: M Wells | last post by:
Hi All, I'm trying to track down a mysterious problem we're experiencing in which updates and inserts to tables in our mssql2k server appear to be 'disappearing.' To explain our situation: ...
5
by: Codeman II | last post by:
Hi there, I am building a form where the user must upload a picture and fill in his details. Now I have a problem as all of this is on the same form. How will I be able to have the Browse...
3
by: Bill | last post by:
I'm using the POST method to submit a simple form html page with yes/no and checkbox fields to an asp response page which stores the values in a new dim string, then uses it to build a new table...
13
by: David W. Fenton | last post by:
I've been struggling the last two days with something I thought was very easy, which is to open a web page with a form on it and populate the form with data passed in a query string (either POST or...
1
by: geckobtz | last post by:
Hi Guys, I am trying to build a page in ASP/MSsql with the aid of dreamweaver, the page contains total of 6 Questions, each question has 3 choices, of which one of the choice contains the right...
1
by: mcfbern | last post by:
I am using a formmail.asp file to send html forms through email and then display a confirmation page to the user saying their information has been sent. Is there any way to display the information...
1
by: runway27 | last post by:
hi i have registration form where user selects from a drop down to select their area code apart from filling other details in the form. in the next page which is a confirmation page i would like...
5
by: jmartmem | last post by:
Greetings, I have built an Update Record Form in an ASP page. This form contains a number of fields, such as text boxes and menus, to name a few. Upon clicking the 'submit' button, I want the...
8
by: nargis2009 | last post by:
Hi, I have been encountering problems with my web page which is supposed to send email, and wondered if anybody can help find error. Initially I had all codes in one page and on click of...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.