出现一个问题!
代码如下:<form>
<input type="button" value="投我一票" onClick="tp();">'调用TP()函数
</form>
<%
sub add()
dim dps
id=request.QueryString("id")
set rss=server.CreateObject("adodb.recordset")
sqlstr="select dps from image2 where id="&id
rss.open sqlstr,conn,1,1
dps=rss("dps")+1
conn.execute("update image2 set dps="&dps&"where id="&id)
response.Cookies("tp").expires=dateadd("y",1,now())
response.cookies("tp")="ture"
session("tp")="ture"
response.Redirect("image2.asp")
end sub
sub tp()
if session("tp")="ture" or request.Cookies("tp")="ture" then
response.Write("<script> alert('你已经投过票了!');location.href='image2.asp';")
response.End()
else
call add()
end if
end sub
%>