Håller på med ett nyhetsbrev. Man fyller i sin mailadress och trycker på submit, då visas texten "du är registrerad" i samma fönster. Går det att göra så att man efter exempelvis 3 sekunder automatiskt kommer tillbaka till startsida?
Nej det fungerar inte om vi lägger in den metataggen i subscribe.asp......
här är kod:
<html>
<html>
<head>
<!-- #include file="DBConnect.inc"-->
</head>
<body>
<%
Dim con, rs, strSql
If Request.Form("cmdSubmit") <> "" Then
'The user has submitted the page, so process the Newsletter subscription request
'Connect to the database
Set con = GetDBConnection()
'Verify that the email address does not already exist in the database
strSql = "SELECT Email FROM Subscribers WHERE Email = '" + Request.Form("txtEmail") + "'"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open strSql, con, 1, 2
If rs.EOF Then
'The email address does not already exist, so add it
rs.AddNew()
rs("Email") = Request.Form("txtEmail")
rs.Update()
'The email address has been added, show confirmation.
'MODIFY the text below is displayed when an email is added to the newsletter
%>
Du är nu registrerad.
<%
Else
'Din mailadress finns redan.
'MODIFY the text below is displayed when a person tries to enter the same email address
' a second time.
%>
Du är redan registrerad.
<%
End If
'Clean up database objects
rs.Close()
Set rs = Nothing
con.Close()
Set con = Nothing
Else
'MODIFY the text below is displayed when the page is first loaded.
%>
<form action="subscribe.asp" method="post">
<div align="center">
Anmäll dig:<br />
<input type="text" name="txtEmail" value=""><br />
<input type="submit" name="cmdSubmit" value="Submit">
</div>
</form>
<%
End If
%>
</body>
</html>