Jag har snurrat bort mig i denna if-sats och hoppas på eran hjälp, jag skall alltså kolla på dom första raderna om det är en epostadress eller inte, är det en epostadress måste jag kolla ifall epostadressen redan finns i databasen, gör den inte det så ska den läggas till, skulle inte epoststrängen innehålla ett @ så skickas användaren till en fel sida. hmm.. kan det bli så här kanske? Hej Fredrik.If sats
Det felmeddelande jag får är.
Expected statement
line 51
End If
<%Dim myemail, rsCheckIF_numRows, rsCheckIF
myemail = Replace(Request.Form("nyhetsbrev"), "'", "''")
If myemail <> "" Then
If ValidEmailAddress(myemail) = True Then
Set rsCheckIF = Server.CreateObject("ADODB.Recordset")
rsCheckIF.ActiveConnection = MM_doggenstore_STRING
rsCheckIF.Source = "SELECT MemberEmailID FROM dbo.dbNoneMemberEmail WHERE MemberEmailID = '"& myemail &"'"
rsCheckIF.CursorType = 0
rsCheckIF.CursorLocation = 2
rsCheckIF.LockType = 1
rsCheckIF.Open()
rsCheckIF_numRows = 0
If rsCheckIF.EOF Then
Response.Redirect("doggenstore.asp?kat")
End If
If request.form("select")="add" Then
set addEmil = Server.CreateObject("ADODB.Command")
addEmil.ActiveConnection = MM_doggenstore_STRING
addEmil.CommandText = "INSERT INTO dbo.dbNoneMemberEmail (MemberEmailID) VALUES ('" & myemail & "') "
addEmil.CommandType = 1
addEmil.CommandTimeout = 0
addEmil.Prepared = true
addEmil.Execute()
strRedirPage = Request.ServerVariables("HTTP_REFERER")
If strRedirPage = "" Then strRedirPage = "doggenstore.asp?k_id=1"
Response.Redirect(strRedirPage)
End If
Elseif request.form("select")="dea" Then
set delEmail = Server.CreateObject("ADODB.Command")
delEmail.ActiveConnection = MM_doggenstore_STRING
delEmail.CommandText = "DELETE FROM dbo.dbNoneMemberEmail WHERE MemberEmailID = '" & myemail & "'"
delEmail.CommandType = 1
delEmail.CommandTimeout = 0
delEmail.Prepared = true
delEmail.Execute()
strRedirPage = Request.ServerVariables("HTTP_REFERER")
If strRedirPage = "" Then strRedirPage = "doggenstore.asp?k_id=1"
Response.Redirect(strRedirPage)
End If
Else
Response.redirect("notvalid.asp")
End If
End If
End If
End If
%>
<%
rsCheckIF.Close()
Set rsCheckIF = Nothing
%>Sv: If sats
<%
Dim myemail, rsCheckIF_numRows, rsCheckIF
myemail = Replace(Request.Form("nyhetsbrev"), "'", "''")
If myemail <> "" Then
If ValidEmailAddress(myemail) = True Then
Set rsCheckIF = Server.CreateObject("ADODB.Recordset")
rsCheckIF.ActiveConnection = MM_doggenstore_STRING
rsCheckIF.Source = "SELECT MemberEmailID FROM dbo.dbNoneMemberEmail WHERE MemberEmailID = '"& myemail &"'"
rsCheckIF.CursorType = 0
rsCheckIF.CursorLocation = 2
rsCheckIF.LockType = 1
rsCheckIF.Open()
rsCheckIF_numRows = 0
If rsCheckIF.EOF Then
Response.Redirect("doggenstore.asp?kat")
End If
If request.form("select")="add" Then
set addEmil = Server.CreateObject("ADODB.Command")
addEmil.ActiveConnection = MM_doggenstore_STRING
addEmil.CommandText = "INSERT INTO dbo.dbNoneMemberEmail (MemberEmailID) VALUES ('" & myemail & "') "
addEmil.CommandType = 1
addEmil.CommandTimeout = 0
addEmil.Prepared = true
addEmil.Execute()
strRedirPage = Request.ServerVariables("HTTP_REFERER")
If strRedirPage = "" Then strRedirPage = "doggenstore.asp?k_id=1"
Response.Redirect(strRedirPage)
Elseif request.form("select")="dea" Then
set delEmail = Server.CreateObject("ADODB.Command")
delEmail.ActiveConnection = MM_doggenstore_STRING
delEmail.CommandText = "DELETE FROM dbo.dbNoneMemberEmail WHERE MemberEmailID = '" & myemail & "'"
delEmail.CommandType = 1
delEmail.CommandTimeout = 0
delEmail.Prepared = true
delEmail.Execute()
strRedirPage = Request.ServerVariables("HTTP_REFERER")
If strRedirPage = "" Then strRedirPage = "doggenstore.asp?k_id=1"
Response.Redirect(strRedirPage)
Else
Response.redirect("notvalid.asp")
End If
End If
End If
rsCheckIF.Close()
Set rsCheckIF = Nothing
%>
Sv:If sats
Bra nära, provade ditt förslag men fick lite fel.
Dessa har jag nu korrigerat, blir tokig att titta på samma kod utan att se felet, så jag tackar och bugar.
Stänger tråden