Hung Up at .dbc. in the dim line
ASP 2.0 site
Microsoft VBScript compilation error '800a0411'
Name redefined
/newslettersubscribe_cn-name.asp, line 7
dim Lname,Sname,email,dbc,cm_name,cm_iytht_iytht,flag, custid,custemail,mySQL,rstemp
----------------------^
Code:
<%option explicit%>
<!-- #include file="shop$db.asp" -->
<html>
<body>
<%
dim Lname,Sname,email,dbc,cm_name,cm_iytht_iytht,flag,custid,custemail,mySQL,rstemp
flag=request("flag")
'Response.Write(submit)
'Response.End()
if flag="y" then
cm_name=request("cm-name")
cm_iytht_iytht=request("cm-iytht-iytht")
Sname=Split(cm_name)
if Ubound(Sname)>0 then
Lname=Sname(Ubound(Sname))
else
Lname=cm_name
end if
shopopendatabase dbc
mySQL="SELECT * FROM customers WHERE email='" &cm_iytht_iytht& "' "
set rstemp=dbc.execute(mySQL)
if rstemp.eof then
sql="insert into customers (lastname,email,custother1) values ('" & Lname & "','" & cm_iytht_iytht & "', 'newsletter')"
dbc.execute(sql)
else
custid = rstemp("contactid")
custemail=rstemp("email")
' update if email present in data base
mySQL="update customers set lastname='" & Lname & "',email='" & cm_iytht_iytht & "',custother1='newsletter' where contactid=" & custid & " and email='" & custemail & "'"
Response.Write(mySQL)
dbc.execute(mySQL)
end if
%>
<form name="news_subs" action="http://createsend.showtheworld.com.au/t/r/s/iytht/" method="post" >
<input type="hidden" name="cm-name" id="cm-name" value="<%=cm_name %>" />
<input type="hidden" name="cm-iytht-iytht" id="cm-iytht-iytht" value="<%=cm_iytht_iytht %>" />
<input type="hidden" name="flag" value="n">
</form>
<script>
document.news_subs.submit();
</script>
<% else
'Response.Redirect"default.asp"
Response.Redirect"http://www.tomswaterhole.com.au/"
end if
%>
</body>
</html>