473,804 Members | 2,160 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Displaying Form Data on a Confirmation Page

1 New Member
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 2430
jhardman
3,406 Recognized Expert Specialist
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
1780
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: We have a web page (written in ASP, if that's relevant) on which we accept enrollment information.
5
5906
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 button to open the "file browse" dialog and the Submit button to submit the form data.
3
2342
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 using ADO. I'm getting sometimes correct values, sometimes null values (when I know I pass a valid default value) and other times multiple values! I know what the values coming over are because I do a response.write to see it before the error...
13
2904
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 GET). I got Application.FollowHyperlink *kind* of working, but was having problem with double encoding of some characters (I had to do special things with + signs in the data, as well as never figuring out why some data was getting...
1
1493
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 answer with a hidden value = to 1 and the wrong choice hidden value = to 0. What i am trying to achieve is to collect the values and insert it to a database and at the same time display the results on the confirmation page. Collecting data’s and...
1
2012
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 the user entered in the form on the confirmation page? Thanks.
1
2838
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 to display the select option that a user choose in the first page i am able to display this using a textfield however i would like to display using the select drop down. following is the code for both select and radio button that i have used. 1....
5
3209
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 form values to pass to a confirmation page that shows the values entered and selected, with a CDONTS auto email generated at the same time. My problem is that I'm having trouble passing the values from the form to both the confirmation page and the...
8
2920
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 Submit it would send email. But then I wanted to give a user an opportunity to go back and edit the entries if incorrect before submitting. I separted the codes into two pages. On the second page when Submit button is clicked it should send email. But...
0
10595
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10343
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10088
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6862
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5529
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5668
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4306
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3831
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3001
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.