|
Hello
I am writing in the hope somebody can assist me with some code. I don't think it is too complicated, but I have had no luck with it.
I have two ASP pages, one with a form (ASP1) on it, and one which is a 'Thank you' page (ASP2).
On ASP1, I have a script which personalises ASP2 (as in 'Thank you John') and which also checks that all form fields have been completed:
<% If Request.Form.Count > 0 Then Name = Trim(Request.Form("t1")) Email = Trim(Request.Form("t2")) Message = Request.Form("S1")
session("t1") = request.form("t1") 'data validation If Name = "" Then ErrorMsg = ErrorMsg & "Please enter your name<br>" End If If Email = "" Then ErrorMsg = ErrorMsg & "Please enter your email address<br>" End If If Message = "" Then ErrorMsg = ErrorMsg & "Please write your message<br>" End If
If ErrorMsg = "" Then 'use this to perform any database validations 'when the name, email and message fields have been checked, redirect the visitor Response.Redirect "welcome1.asp" End If End If %>
<form action="<%= Request.ServerVariables("SCRIPT_NAME") %>" method=post>
<% If ErrorMsg <> "" Then %> <p><font color="#FFFFFF"><b><%= ErrorMsg %></b></font><p>
<% End If %>
The form fields concerned are as follows:
<input type=text name=t1 value="<%= t1 %>"> <input type=text name=t2 value="<%= t2 %>"> <textarea name=S1 value="<%= S1 %>"></textarea>
On ASP2, I have:
<p>Thank you <%= session("t1") %></p>
which is the script which personalises the page.
Also on ASP2, and unrelated to the above script, I have the following CDONTS code:
<% Dim t1name,t1,t2name,t2 t1name = "name" t1 = Request.Form("t1") t2name = "email" t2 = Request.Form("t2") Dim stname,st stname = "comments" st = Request.Form("s1") Dim ObjMail Set ObjMail = Server.CreateObject("CDONTS.NewMail") ObjMail.To = " mailto:me1@aol.com - me1@aol.com " ObjMail.CC = t2 ObjMail.From = t2 ObjMail.Subject = "Feedback" ObjMail.Body = t1name & vbcrlf&_ t1 & vbcrlf&_ t2name & vbcrlf&_ t2 & vbcrlf&_ stname & vbcrlf&_ st ObjMail.Send Set ObjMail = Nothing %>
My message to this forum conerns this: the CDONTS code should send an email to the Webmaster and a copy to the person who filled in the form. It doesn't work, and I can't understand why, though I suspect it is something to do with the variables.
If anybody can help, I would be grateful (and please forgive the names which I have given to the variables).
Best wishes
madHatter
|