⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 counter.asp

📁 使用Asp+Access+FSO+Jmail+Servu开发
💻 ASP
字号:
<%
Response.CacheControl = "no-cache"
Response.AddHeader "Pragma", "no-cache"
Response.Expires = 0
%>
<!--#include file="chkuser.asp"-->
<!--#include file="config.asp"-->
<!--#include file="inc/user.asp"-->
<%
username=Request.Cookies("username")
sql="select * from counter where username='"&username&"'"
rs.open sql,conn,1,3
if rs.eof and rs.bof then
response.write "<script language=javascript>alert('您的计数器还没有生效\n\n点击[确定]将自动生效!')</script>"
set rs1=Server.CreateObject("ADODB.Recordset")
sql1="select * from counter"
rs1.open sql1,conn,1,3
rs1.addnew
rs1("username")=username
rs1("date")=Date()
rs1("counter")=0
rs1.update
response.write "<script language=javascript>alert('您的计数器已经生效\n\n请在您的网站适当位置加入计数器代码!');location.href='counter.asp'</script>"
rs1.close
set rs1=nothing
end if
if request("action")="edit" then
set rs2=Server.CreateObject("ADODB.Recordset")
sql2="select * from counter where username='"&username&"'"
rs2.open sql2,conn,1,3
rs2("style")=request.Form("style")
if request.form("reset")="yes" then
rs2("counter")=0
end if
rs2.update
response.write "<script language=javascript>alert('修改成功!');location.href='javascript:history.back()'</script>"
rs2.close
set rs2=nothing
end if
%>
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="css/style.css" rel="stylesheet" type="text/css">
<SCRIPT language=javascript>
function popwin(url,name,width,height,scroll)
{
  var Left_size = (screen.width) ? (screen.width-width)/2 : 0;
  var Top_size = (screen.height) ? (screen.height-height)/2 : 0;
  var open_win=window.open(url,name,'width=' + width + ',height=' + height + ',left=' + Left_size + ',top=' + Top_size + ',toolbar=no,scrollbars=' + scroll + '' );
}
</SCRIPT>
<title></title>
</head>
<body bgcolor="#F6ECE2">
<table width="100%" border="0" cellspacing="0" cellpadding="0" height="70%">
  <tr> 
    <td align="center">
<fieldset style="padding: 2; width:200; height:120">
<legend><b>网站计数器</b></legend> 
<table width=450 align="center" cellpadding=3 cellspacing=1>
<form name="form1" action="?action=edit" method="post" onSubmit="javascript:form1.Submit.disabled=true;">
  <tr>
    <td colspan="2"><p>提示:<br>
      1.如需加入用户网站排行,请在您网站适当位置加入计数器代码<br>
2.本计数系统采用防刷新机制,以确保统计准确</p>    </td>
  </tr>
  <tr>
    <td>网站地址:</td>
    <td><a href="<%=rshost("userurl")%>/<%=Request.Cookies("username")%>" target="_blank"><%=rshost("userurl")%>/<%=Request.Cookies("username")%></a></td>
  </tr>
  <tr>
    <td width="102">计数器代码:</td>
    <td><textarea name="text" cols="50" rows="3" class="input" title="请用Ctrl+C复制" onMouseOver="this.select();"><script language="JavaScript" src="<%=siteurl%>/count.asp?id=<%=username%>"></script>
</textarea></td>
  </tr>
  <tr>
    <td>开始统计日期:</td>
    <td><%=formatdatetime((rs("date")),1)%></td>
  </tr>
  <tr>
    <td>选择计数器样式:</td>
    <td><SELECT NAME="style" id="style">
          <OPTION VALUE="1" <%if int(rs("style"))=1 then response.write("selected")%> >样式1</OPTION>
          <OPTION VALUE="2" <%if int(rs("style"))=2 then response.write("selected")%>>样式2</OPTION>
          <OPTION VALUE="3" <%if int(rs("style"))=3 then response.write("selected")%>>样式3</OPTION>
          <OPTION VALUE="4" <%if int(rs("style"))=4 then response.write("selected")%>>样式4</OPTION>
          <OPTION VALUE="5" <%if int(rs("style"))=5 then response.write("selected")%>>样式5</OPTION>
          <OPTION VALUE="6" <%if int(rs("style"))=6 then response.write("selected")%>>样式6</OPTION>
          <OPTION VALUE="7" <%if int(rs("style"))=7 then response.write("selected")%>>样式7</OPTION>
          <OPTION VALUE="8" <%if int(rs("style"))=8 then response.write("selected")%>>样式8</OPTION>
          <OPTION VALUE="9" <%if int(rs("style"))=9 then response.write("selected")%>>样式9</OPTION>
          <OPTION VALUE="10" <%if int(rs("style"))=10 then response.write("selected")%>>样式10</OPTION>
          <OPTION VALUE="11" <%if int(rs("style"))=11 then response.write("selected")%>>样式11</OPTION>
          <OPTION VALUE="12" <%if int(rs("style"))=12 then response.write("selected")%>>样式12</OPTION>
          <OPTION VALUE="13" <%if int(rs("style"))=13 then response.write("selected")%>>样式13</OPTION>
          <OPTION VALUE="14" <%if int(rs("style"))=14 then response.write("selected")%>>样式14</OPTION>
        </SELECT>
    [<A href=javascript:void(0) onclick="javascript:popwin('count_style/count_style.asp','',600,300,'no')">预览样式</A>]</td>
  </tr>
  <tr>
    <td>总流量:</td>
    <td><strong><%=rs("counter")%></strong></td>
  </tr>
  <tr>
    <td>计数初始化:</td>
    <td width="331"><select name="reset" id="reset">
      <option value="yes">是</option>
      <option value="no" selected>否</option>
    </select>    </td>
  </tr>
  <tr align="center">
    <td colspan="2"><input name="Submit" type="submit" class="button" value="提交"></td>
    </tr></form>
</table>
</fieldset></td>
  </tr>
</table>
</body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -