主题:如何让刷新不让计数器加1
我采用一个计数器代码如下,现在我想让计数器在刷新页面的时候不加1,但重新开窗口又能加1
以下代码该如何修改
<%
set rs = Server.CreateObject("ADODB.Recordset")
sql = "select*from xxswe where id = "&Request("id")&""
rs.Open sql,conn,1,3
dim readcount1
if not rs.EOF then
readcount1 = rs("readcount")
application.Lock()
application("readcount1") = application("readcount1")+1
application.unLock()
else
response.Write"该标题不存在"
response.End
rs.Close()
end if
%>
<%
sql = "select*from xxswe where id = "&Request("id")&""
rs.Open sql,conn,1,3
if not rs.EOF then
rs("readcount") = readcount1+1
rs.Update()
else
response.Write"该标题不存在"
response.End
rs.Close()
end if
%>
以下代码该如何修改
<%
set rs = Server.CreateObject("ADODB.Recordset")
sql = "select*from xxswe where id = "&Request("id")&""
rs.Open sql,conn,1,3
dim readcount1
if not rs.EOF then
readcount1 = rs("readcount")
application.Lock()
application("readcount1") = application("readcount1")+1
application.unLock()
else
response.Write"该标题不存在"
response.End
rs.Close()
end if
%>
<%
sql = "select*from xxswe where id = "&Request("id")&""
rs.Open sql,conn,1,3
if not rs.EOF then
rs("readcount") = readcount1+1
rs.Update()
else
response.Write"该标题不存在"
response.End
rs.Close()
end if
%>