Hello,
I am trying to print out some text "Thanks for editing..." after the user edit the form from database, but it does not work. After I edit this form, it showed a blank page. When I check at the edited text, it was there. I meant, the form worked, but it does not say "Thanks for editing..." or any text.
Can you please show me how to print out "thanks for editing..." after the user edit this form.
Thanks.
<%
On Error Resume Next
Function ChkString(string)
If string = "" Then string = " "
ChkString = Replace(string, "'", "'"
End Function
dim objMail, BodyText, conn1, strConnect
dim FNAme, LName, MName, SSN, Email
Dim strErrorEmail
strErrorEmail = "test@yahoo.com"
' Receiving values from Form
FNAme = ChkString(Request.Form("First_Name")
LName = ChkString(Request.Form("Last_Name")
MName = ChkString(Request.Form("Middle_Name")
SSN = ChkString(Request.Form("SSN")
Email = ChkString(Request.Form("Email_Address")
strConnect = ""
set conn1 = server.CreateObject("ADODB.Connection"
conn1.ConnectionString=strConnect
conn1.ConnectionTimeout=30
conn1.open
if request.QueryString("type" = "D" then
sql_update = "DELETE FROM Echoes WHERE Email_Address = '" & Email & "'"
else
sql_update = "UPDATE Echoes SET First_Name = '" & FName & "', Last_Name = '" & LName & "', Middle_Name = '" & MName & "', SSN = '" & SSN & "', Email_Address = '" & email & "' WHERE Email_Address = '" & email & "'"
end if
conn1.Execute sql_update
%>
<%
If Err.Number <> 0 Then
Response.Clear
set objMail=Server.CreateObject("CDONTS.Newmail"
IsObj= isobject(objMail)
if IsObj Then
BodyText = "Page Error" & Chr(13) & Chr(13)
BodyText = BodyText & "Error Number: " & Err.Number & Chr(13)
BodyText = BodyText & "Error Description: " & Err.Description & Chr(13)
BodyText = BodyText & "Source: " & Err.Source & Chr(13) & Chr(13)
' BodyText = BodyText & "LineNumber: " & Err.Line & Chr(13) & Chr(13)
BodyText = BodyText & "First Name: " & FName & Chr(13)
BodyText = BodyText & "Middle Initial: " & MName & Chr(13)
BodyText = BodyText & "Last Name: " & LName & Chr(13)
BodyText = BodyText & "Social Security Number: " & SSN & Chr(13)
BodyText = BodyText & "Email: " & Email & Chr(13)
objMail.From="test@hqda.army.mil"
' objMail.To = "test1@hqda.army.mil"
objMail.To = "test3@hqda.army.mil"
objMail.Subject = "Error with test G-1 Echoes Edit/Delete"
objMail.Body = BodyText
objMail.Send
Set objMail = Nothing
else
strMsg = "The email failed. Please try again."
end if
response.Write("<br>sql statement: " & sql_update)
conn1.Close
Set conn1 = Nothing
%>
<div id="wrap">
<div id="main">
<div id="content">
<h3 align="center">Edit/Delete</h3><p>error occurred.</p>
</div>
</div>
<%
Else
Response.Redirect("register.asp"
End If
%>
</div>
I am trying to print out some text "Thanks for editing..." after the user edit the form from database, but it does not work. After I edit this form, it showed a blank page. When I check at the edited text, it was there. I meant, the form worked, but it does not say "Thanks for editing..." or any text.
Can you please show me how to print out "thanks for editing..." after the user edit this form.
Thanks.
<%
On Error Resume Next
Function ChkString(string)
If string = "" Then string = " "
ChkString = Replace(string, "'", "'"
End Function
dim objMail, BodyText, conn1, strConnect
dim FNAme, LName, MName, SSN, Email
Dim strErrorEmail
strErrorEmail = "test@yahoo.com"
' Receiving values from Form
FNAme = ChkString(Request.Form("First_Name")
LName = ChkString(Request.Form("Last_Name")
MName = ChkString(Request.Form("Middle_Name")
SSN = ChkString(Request.Form("SSN")
Email = ChkString(Request.Form("Email_Address")
strConnect = ""
set conn1 = server.CreateObject("ADODB.Connection"
conn1.ConnectionString=strConnect
conn1.ConnectionTimeout=30
conn1.open
if request.QueryString("type" = "D" then
sql_update = "DELETE FROM Echoes WHERE Email_Address = '" & Email & "'"
else
sql_update = "UPDATE Echoes SET First_Name = '" & FName & "', Last_Name = '" & LName & "', Middle_Name = '" & MName & "', SSN = '" & SSN & "', Email_Address = '" & email & "' WHERE Email_Address = '" & email & "'"
end if
conn1.Execute sql_update
%>
<%
If Err.Number <> 0 Then
Response.Clear
set objMail=Server.CreateObject("CDONTS.Newmail"
IsObj= isobject(objMail)
if IsObj Then
BodyText = "Page Error" & Chr(13) & Chr(13)
BodyText = BodyText & "Error Number: " & Err.Number & Chr(13)
BodyText = BodyText & "Error Description: " & Err.Description & Chr(13)
BodyText = BodyText & "Source: " & Err.Source & Chr(13) & Chr(13)
' BodyText = BodyText & "LineNumber: " & Err.Line & Chr(13) & Chr(13)
BodyText = BodyText & "First Name: " & FName & Chr(13)
BodyText = BodyText & "Middle Initial: " & MName & Chr(13)
BodyText = BodyText & "Last Name: " & LName & Chr(13)
BodyText = BodyText & "Social Security Number: " & SSN & Chr(13)
BodyText = BodyText & "Email: " & Email & Chr(13)
objMail.From="test@hqda.army.mil"
' objMail.To = "test1@hqda.army.mil"
objMail.To = "test3@hqda.army.mil"
objMail.Subject = "Error with test G-1 Echoes Edit/Delete"
objMail.Body = BodyText
objMail.Send
Set objMail = Nothing
else
strMsg = "The email failed. Please try again."
end if
response.Write("<br>sql statement: " & sql_update)
conn1.Close
Set conn1 = Nothing
%>
<div id="wrap">
<div id="main">
<div id="content">
<h3 align="center">Edit/Delete</h3><p>error occurred.</p>
</div>
</div>
<%
Else
Response.Redirect("register.asp"
End If
%>
</div>