<%
Dim rs, isBanned
set rs = mincon.execute("SELECT count(*) from ipsparr WHERE ip = '& Request.ServerVariables("REMOTE_HOST") &'"
isBanned = rs(0)
Set rs = Nothing
if isBanned <> 0 then 'Snubben är bannad
Response.Redirect "http://www.hell.com"
End if
sql = "SELECT * from gastbok"
rs.open sql, mincon, 3, 3
'...Annan kod
%>
Expected ')'
/gastbok_in.asp, line 14
set rs = mincon.execute("SELECT count(*) from ipsparr WHERE ip = '& Request.ServerVariables("REMOTE_HOST") &'"
---------------------------------------------------------------------------------------------^
Så här ser hela filen gastbok_in.asp ut
<html>
<head>
<meta name="generator" content="microsoft visual studio 6.0">
<!-- #include file="muffins.asp" -->
<!-- #include file="check_gb.asp"-->
</head>
<body>
<%
Dim rs, isBanned
set rs = mincon.execute("SELECT count(*) from ipsparr WHERE ip = '& Request.ServerVariables("REMOTE_HOST") &'"
isBanned = rs(0)
Set rs = Nothing
if isBanned <> 0 then 'Snubben är bannad
Response.Redirect "http://www.hell.com"
End if
sql = "SELECT * from gastbok"
rs.open sql, mincon, 3, 3
rs.addnew
rs("NAME")=Request.Form("NAME")
rs("EMAIL")=Request.Form("EMAIL")
rs("HOMEPAGE")=Request.Form("HOMEPAGE")
rs("CITY")=Request.Form("CITY")
rs("MESSAGE")=Request.Form("MESSAGE")
rs("DAT")=Request.Form("DAT")
rs("SMILE")=Request.Form("SMILE")
Rs("IP") = Request.ServerVariables("REMOTE_ADDR")
rs.update
rs.close
%>
<%Response.Redirect("gastbok_las.asp")%>
</body>
</html>
set rs = mincon.execute("SELECT count(*) from ipsparr WHERE ip = '& Request.ServerVariables("REMOTE_HOST") &'")
får fortfarande error
ursäkta att jag fattar dåligt :)
felmeddelandet:
Expected ')'
/gastbok_in.asp, line 14
set rs = mincon.execute("SELECT count(*) from ipsparr WHERE ip = '& Request.ServerVariables("REMOTE_HOST") &'")
---------------------------------------------------------------------------------------------^
jag tycker alla parenteser är avslutade.
det perkar ju på R, där Remote hos börjar. Har det något med det att göra??
Rad 23: rs.open sql, mincon, 3, 3
Men med vilket rs? Du har ju på rad 15 satt rs = Nothing. Du har inget rs kvar att använda. Därav problemet. Du måste instansiera ett nytt rs innan du kan använda det.
följande kod har inte jag skrivit, utan fått av en här på forumet.
och det är den som felar.
<%
Dim rs, isBanned
set rs = mincon.execute("SELECT count(*) from ipsparr WHERE ip = '& Request.ServerVariables("REMOTE_HOST") &'"
isBanned = rs(0)
Set rs = Nothing
if isBanned <> 0 then 'Snubben är bannad
Response.Redirect "http://www.hell.com"
End if