I have a HTML page for user to input email address. Then it will go to an ASP page to connect to a database. After that, I want to go back to the HTML page. No error for database part. However, my following code does not redirect the page back to the HTML page.
Thanks for any help.
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<%
'AddToNewsLetter = Request.Form("yes_news")
'If AddToNewsLetter <> "" Then
ConnString = "DRIVER={Microsoft Access Driver (*.mdb)};"
ConnString = ConnString & "DBQ=" & Server.Mappath("NewsLetter.mdb")
Set adoConn = Server.CreateObject("ADODB.Connection")
adoConn.Open ConnString
sql="INSERT INTO NewsLetterAdd (Email)"
sql=sql & " VALUES "
sql=sql & "('" & Request.Form("news_email") & "')"
on error resume next
adoConn.Execute sql
if err<>0 then
response.write("Something wrong")
else
response.write("Everything is good")
Response.Redirect "ipoll_features.html"
end if
'End If
%>
</body>
</html>
Thanks for any help.
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<%
'AddToNewsLetter = Request.Form("yes_news")
'If AddToNewsLetter <> "" Then
ConnString = "DRIVER={Microsoft Access Driver (*.mdb)};"
ConnString = ConnString & "DBQ=" & Server.Mappath("NewsLetter.mdb")
Set adoConn = Server.CreateObject("ADODB.Connection")
adoConn.Open ConnString
sql="INSERT INTO NewsLetterAdd (Email)"
sql=sql & " VALUES "
sql=sql & "('" & Request.Form("news_email") & "')"
on error resume next
adoConn.Execute sql
if err<>0 then
response.write("Something wrong")
else
response.write("Everything is good")
Response.Redirect "ipoll_features.html"
end if
'End If
%>
</body>
</html>