📄 modify.asp
字号:
<!--#include file="include.asp"-->
<%
dim user,title,web_url,path,count,ip_hits
dim error,err_msg,back,fullpath
dim sql,rs
user=trim(request("user"))
error=0
if not session("log") then response.redirect "login.asp"
if request.form("submit")<>empty then call modi_user()
sql="select * from cnt_msg where user01='"&user&"'"
set rs=conn.execute(sql)
if not rs.eof then
title=rs("title")
web_url=rs("web_url")
path=rs("path")
count=rs("count01")
ip_hits=rs("ip_hits")
end if
%>
<html>
<head>
<title>修改设置</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
td { font-size: 9pt}
input { font-size: 9pt}
.button { font-size: 9pt; color: #FFFFFF; background-color: #000000}
a { text-decoration: none}
-->
</style>
</head>
<body bgcolor="#6A4F9A" text="#FFFFFF">
<div align="center">
<form method="post" action="modify.asp?user=<%=user%>" name="form02">
<p> </p>
<table width="372" border="1" cellspacing="0" bordercolorlight="#999999" bordercolordark="#FFFFFF" cellpadding="2">
<tr bgcolor="#CCCCCC">
<td colspan="3" align="center" height="28"><font color="#FFFFFF"><font color="#000000">修
改 计 数 器 设 置</font></font></td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="102" align="right"><font color="#000000">用户名称:</font></td>
<td colspan="2" width="256"><font color="#000080"><%=user%></font>
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="102" align="right"><font color="#000000">网站名称:</font></td>
<td colspan="2" width="256">
<input type="text" name="title" size="30" maxlength="30" value="<%=title%>">
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="102" align="right"><font color="#000000">网站地址:</font></td>
<td colspan="2" width="256">
<input type="text" name="web_url" size="30" maxlength="100" value="<%=web_url%>">
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="102" align="right"><font color="#000000">总IP次数:</font></td>
<td colspan="2" width="256">
<input type="text" name="ip_hits" size="30" maxlength="30" value="<%=ip_hits%>">
<font color="#990000"> 初始</font></td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="102" align="right"><font color="#000000">总访问次数:</font></td>
<td colspan="2" width="256">
<input type="text" name="count" size="30" maxlength="30" value="<%=count%>">
<font color="#990000">初始</font> </td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="102" align="right" height="33"><font color="#000000">计数器地址:</font></td>
<td colspan="2" width="256" height="33">
<input type="text" name="path" size="30" maxlength="150" value="<%=path%>">
<font color="#990000">初始</font> </td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="102" align="right" height="31"><font color="#990000">历史记录:</font></td>
<td colspan="2" width="256" height="31"><font color="#003399">【<a href="list_history.asp?user=<%=user%>" target="_blank">查看</a>】【<a href="del_history.asp?user=<%=user%>" target="_blank">删除7天前</a>】【<a href="del_history.asp?all=y&user=<%=user%>" target="_blank">全部删除</a>】</font></td>
</tr>
<tr bgcolor="#FFFFFF" align="center">
<td colspan="3" height="47">
<input type="submit" name="Submit" value="修改" class="button">
<input type="reset" name="reset" value="重输" class="button">
<input type="button" name="Submit2" value="关闭" class="button" onclick="javascript:window.close()">
</td>
</tr>
</table>
<br>
</form>
<p> </p>
</div>
</body>
<%
conn.close()
set conn=nothing
%>
</html>
<%
function modi_user()
title=trim(request.form("title"))
web_url=trim(request.form("web_url"))
path=trim(request.form("path"))
count=trim(request.form("count"))
ip_hits=trim(request.form("ip_hits"))
if title=empty then error=1
if web_url=empty then web_url="http://"
if path=empty then error=2
if count=empty then count=0
if ip_hits=empty then ip_hits=0
if not isnumeric(count) then error=4
if not isnumeric(ip_hits) then error=5
if error<>0 then
back="<a href='javascript:history.back()'>返回</a>"
select case error
case 1
err_msg="网站名称不能为空!"&back
case 2
err_msg="计数器地址不能为空!"&back
case 3
err_msg="用户名称不能为空!"&back
case 4
err_msg="总访问次数必须为数字!"&back
case 5
err_msg="总IP次数必须为数字!"&back
end select
response.write err_msg
conn.close()
set conn=nothing
response.end
else
sql="update cnt_msg set title='"&title&"',web_url='"&web_url&"',path='"&path&"',count01="&count&",ip_hits="&ip_hits&" where user01='"&user&"'"
conn.execute(sql)
response.write "修改信息成功!!<p>"
fullpath="<script src='"&path&"/counter.asp?user="&user&"'></script>"
fullpath=server.htmlencode(fullpath)
response.write "计数器连接代码:<p>"&fullpath
conn.close()
set conn=nothing
response.end
end if
end function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -