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

📄 singleuser.asp

📁 是个关于asp做得聊天室
💻 ASP
字号:
<%@ Language=VBScript %>
<html>
<head>
<meta NAME="GENERATOR" Content="Microsoft FrontPage 4.0">
<title></title>
<style fprolloverstyle>A:hover {color: red; font-weight: bold}
</style>
</head>
<body bgcolor="#9999FF">
<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 color="#FF0000"><div align="center"><center><p>请输入帐号:</font>
  <input  type="text" name="Admin_UID" size="21"
  style="color: rgb(255,0,0); background-color: rgb(0,255,255)"></p>
  </center></div>
  <div align="center"><center><p><font color="#FF0000"> 请输入密码:</font>
  <input  type="password" name="Admin_PWD" size="21"  style="background-color: rgb(0,255,255); color: rgb(255,0,0)"></p>
  </center></div>
  <div align="center"><center><p><input type="submit" value="提交"  name="B1">
  <input type="reset" value="重写" name="B2"></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 size="8" cols="36" name="userid" multiple style="color: #FF0000; background-color: #000000; font-weight: bold" 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" style="font-family: 幼圆; color: #008000; background-color: #000000; font-weight: bold"></textarea><br>
  <font color="#FF0000"><div align="center"><center><p>请输入帐号:</font>
  <input  type="text" name="Admin_UID" size="21"
  style="color: rgb(255,0,0); background-color: rgb(0,255,255)"></p>
  </center></div>
  <div align="center"><center><p><font color="#FF0000"> 请输入密码:</font>
  <input  type="password" name="Admin_PWD" size="21"  style="background-color: rgb(0,255,255); color: rgb(255,0,0)"></p>
  
 
  <input type="submit" value="提交" name="B1" style="background-color: #00FFFF; color: #FF0000"><input type="reset" value="全部重写" name="B2" style="color: #FF0000; text-decoration: blink; background-color: #00FFFF"></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 + -