userip.asp
资源名称:1.rar [点击查看]
上传用户:ziqing_518
上传日期:2022-08-09
资源大小:446k
文件大小:3k
源码类别:
多媒体编程
开发平台:
ASP/ASPX
- <!--#include file="users.asp" -->
- <!--#include file="config.asp" -->
- <!--#include file="../md5.asp" -->
- <!--#include file="cookies.asp" -->
- <%
- if rs4("boolUser")=False then
- Response.Redirect "index.asp"
- end if
- end if
- rs.close
- set rs=nothing
- end if
- %>
- <!--#include file="function.asp" -->
- <!--#include file="code.asp" -->
- <!--#include file="first.asp" -->
- <table border=0 cellspacing=0 style='border-collapse:collapse' width=735 height=233 cellpadding=3>
- <tr>
- <td width=185 valign=top>
- <!--#include file="inc.asp" -->
- </td>
- <td width=550 valign=top>
- <form name="ipdelform" method="post" action="userip.asp?post=del">
- <table width="100%" border="0" cellpadding="2" cellspacing="1" bgcolor="#000000">
- <tr align="center">
- <td width="5%" bgcolor="#EFEFEF">删?</td>
- <td width="25%" bgcolor="#EFEFEF">操作者</td>
- <td width="40%" bgcolor="#EFEFEF">时间</td>
- <td width="30%" bgcolor="#EFEFEF">IP限制段</td>
- </tr>
- <%
- if Request.QueryString("post")="del" then
- conn.execute("delete from [ip] where id in ("&replace(request.form("id"),"'","")&")")
- elseif Request.QueryString("post")="add" then
- strIPaddress=split(Request.Form("ipaddress"),".")
- for i=0 to UBound(strIPaddress)
- if strIPaddress(i)="*" then
- numIP=i
- exit for
- end if
- next
- for i=0 to UBound(strIPaddress)
- if numIP<>"" then
- if numIP<i then
- strIPaddress(i)="*"
- end if
- end if
- ipaddress=ipaddress+strIPaddress(i)&"."
- next
- ipaddress=left(ipaddress,len(ipaddress)-1)
- if numIP="" then
- numIP=4
- end if
- conn.execute("insert into ip(strIPaddress,numIP,dateTimers,strAdmin) values('"& ipaddress &"',"& numIP &",'"& now() &"','"& request.cookies("nicedown")("admin") &"')")
- end if
- Set rs =Server.CreateObject("ADODB.Recordset")
- sql="select * from ip order by dateTimers desc"
- rs.open sql,conn,1,1
- if rs.eof then
- response.write("<tr align=""center"" bgcolor=""#FFFFFF"">"& vbCRLF & _
- "<td colspan=""4"">还没有IP限制地址</td>"& vbCRLF & _
- "</tr>")
- else
- do while not rs.eof
- response.write("<tr align=""center"" bgcolor=""#FFFFFF"">"& vbCRLF & _
- "<td width=""5%""><input type=""checkbox"" name=""id"" value="""& rs("id") &"""></td>"& vbCRLF & _
- "<td width=""25%"">"& rs("strAdmin") &"</td>"& vbCRLF & _
- "<td width=""40%"">"& rs("dateTimers") &"</td>"& vbCRLF & _
- "<td width=""30%"">"& rs("strIPaddress") &"</td>"& vbCRLF & _
- "</tr>")
- rs.movenext
- loop
- end if
- rs.close
- set rs=nothing
- response.write("<tr align=""center"" bgcolor=""#FFFFFF"">"& vbCRLF & _
- "<td colspan=""4""><input type=""submit"" name=""Submit"" value=""执行操作"" onclick=""{if(confirm('您确定执行的操作吗?')){return true;}return false;}""></td>"& vbCRLF & _
- "</tr>")
- %>
- </table>
- </form>
- <br>
- <form name="form2" method="post" action="userip.asp?post=add">
- <table width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td align="center">
- <input type="text" name="ipaddress" value="<%=Request.QueryString("ip")%>">
- <input type="submit" name="Submit" value="添加IP限制段"><br>(可以使用“*”作为通配符禁止某段地址,“*”后面的地址将自动转换为“*”)
- </td>
- </tr>
- </table>
- </form>
- </td>
- </tr>
- </table>
- <br><hr width=735>
- <center>