📄 singleuser.asp
字号:
<%@ Language=VBScript %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>聊天室程序</title>
<style fprolloverstyle>
A:hover {color: red; font-weight: bold}
</style>
<link href="style.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style1 {color: #000000}
-->
</style>
</head>
<body >
<script language="javascript">
<!--
function check()
{
if (document.message.userid.selectedIndex==0 )
{
document.message.userid.multiple=false
}
else
{
document.message.userid.multiple=true
}
}
function check1()
{
var ssubmit
ssubmit=true
if (document.message.userid.options[0].value=="none")
{
window.alert ("没有在线用户!")
ssubmit=false
}
if (document.message.content.value =="")
{
window.alert ("请输入信息内容!")
ssubmit=false
}
return ssubmit
}
//-->
</script>
<%
if Request.ServerVariables ("REQUEST_METHOD")<>"POST" then
userid=Request.Form ("userid")
%>
<form method="POST" action="singleuser.asp" name="check">
<font><div align="center"><center><p>请输入帐号:
<input name="Admin_UID" type="text" class="smallInput" size="21">
</p>
</center></div>
<div align="center"><center><p>请输入密码:
<input name="Admin_PWD" type="password" class="smallInput" size="21">
</p>
</center>
</div>
<div align="center"><center><p><input name="B1" type="submit" class="smallInput" value="提交">
<input name="B2" type="reset" class="smallInput" value="重写">
</p>
</center></div>
</form>
<%
else
set newconn=server.CreateObject ("ADODB.Connection")
newconn.ConnectionString ="DSN=ChatRoom"
newconn.Open
newsql="select Right from EverUser where UserID='" & Request.Form ("Admin_UID") & "' and PWD='" & Request.Form ("Admin_PWD") & "'"
set newrecord0=newconn.Execute (newsql)
if newrecord0.bof then
Response.Write ("密码和帐号输入错误!<br>")
else
if newrecord0(0)<>9 then
Response.Write ("你没有权限进入!")
Response.End
else
if Request.Form ("content")<>"" then
for each item in Request.Form ("userid")
if item="all" then
newsql="select UserID from UserOnLine"
set temprecord=newconn.Execute (newsql)
do while not temprecord.eof
application(temprecord(0))="<br>管理员对你说:<br><font color=purple size=4>" & Request.Form ("content") & "</font><br><br>" & application(temprecord(0))
temprecord.movenext
loop
temprecord.close
set temprecord=nothing
exit for
else
application(item)="<br>管理员对你说:<br><font color=purple size=4>" & Request.Form ("content") & "</font><br><br>" & application(item)
end if
next
end if
newsql="select UserID,NickName from UserOnLine"
set newrecord=newconn.Execute (newsql)
%>
<p align="center"><font size="6" face="华文琥珀" width="200">信息发送</font></p>
<form method="POST" action="singleuser.asp" name="message" onSubmit="return check1()">
<p align="center"><select name="userid" size="8" multiple class="smallInput" cols="36" onclick="check()">
<%
if newrecord.bof then
%>
<option value="none">没有线上用户</option>
<%
else
%>
<option value="all">所有人</option>
<%
end if
%>
<%
do while not newrecord.eof
%>
<option value="<% =newrecord(0) %>"><% =newrecord(1) %></option>
<%
newrecord.movenext
loop
%>
</select>
<textarea rows="8" name="content" cols="36" ></textarea><br>
<font><div align="center"><center><p>请输入帐号:
<input name="Admin_UID" type="text" class="smallInput" size="21">
</p>
</center></div>
<div align="center"><center><p> 请输入密码:
<input name="Admin_PWD2" type="password" class="smallInput" size="21">
</p>
<input name="B1" type="submit" class="smallInput" value="提交" ><input name="B2" type="reset" class="smallInput" value="全部重写"></p>
</center>
</div>
</form>
<center><a href="foreveruser.asp">永久用户管理</a></center>
<center><a href="admin.asp">在线用户管理</a></center>
<%
newrecord.close
set newrecord=nothing
newconn.Close
set newconn=nothing
end if
end if
end if
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -