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

📄 usermess.asp

📁 不错的ASP整站源代码。在IIS环境下运行都没有问题
💻 ASP
字号:
<% 
username=Session("UserName")
rename=request("user")

'叛断Session变量是否超时
if isempty(session("u_id")) then
   response.redirect "../timeout.asp"
end if

'叛断此用户是否已经注册
if session("u_id")=1 then response.redirect "../notreg.asp"
if session("username")="" then response.redirect "../notreg.asp"
%>

<html>
<head>
<title>发送短消息</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
body,td{font-size:9pt;}
A:link {COLOR: #000000; TEXT-DECORATION: none; font-size: 9pt}
A:active {COLOR: #000000; TEXT-DECORATION: none; font-size: 9pt}
A:visited {COLOR: #000000; TEXT-DECORATION: none; font-size: 9pt}
.put {
	BORDER-RIGHT: #f7e0e0 1px solid; BORDER-TOP: #f7e0e0 1px solid; FONT-SIZE: 9pt; BORDER-LEFT: #f7e0e0 1px solid; COLOR: #000000; BORDER-BOTTOM: #f7e0e0 1px solid; BACKGROUND-COLOR: white; PADDING-RIGHT: 1px; PADDING-LEFT: 1px;PADDING-BOTTOM: 1px; PADDING-TOP: 1px;
}
.put1 {
	BORDER-RIGHT: #f7e0e0 1px solid; BORDER-TOP: #f7e0e0 1px solid; FONT-SIZE: 9pt; BORDER-LEFT: #f7e0e0 1px solid; COLOR: #000000; BORDER-BOTTOM: #f7e0e0 1px solid; BACKGROUND-COLOR: #fff4f4; PADDING-RIGHT: 1px; PADDING-LEFT: 1px;PADDING-BOTTOM: 1px; PADDING-TOP: 1px; HEIGHT: 18px;
}
</style>
</head>
<script language="javascript">
<!--
   function saysfocus( )
    {
	   //top.main1.scroll(0, 65000);
           //setTimeout('scrollWindow()', 200);
            document.inputform.message.focus();
           //parent.userlist.location.reload();	
	}
-->
</script>

<body bgcolor=#FFFFFF topMargin="4" MARGINWIDTH="5" MARGINHEIGHT="4">
<%
if request("message")<>"" then '把request("submit")改成了request("message") /by c.t. 14:46 19991020
    if trim(request("message"))<>"" then
       towhom=request("to")
       if towhom="0" then towhom=username
       if towhom=""  then towhom=username
       from=request("myself")
       message=request("message")
       mymessage=from&"&&"&towhom&"&&"&message
       Application.Lock
       application("message")=Application("message")&mymessage&"||"
       Application.UnLock
       Response.write "<br><p align=center>"&from&",你的信息发送成功</p>"
       %>
      <script language="javascript">
      <!--
      window.self.close();
      -->
      </script>
<%else
       Response.Write  "<p align=center><font color=red>发信内容不能为空</font>"
     end if
 else
 %>
<form action=usermess.asp method=post name=inputform>
  <table border="0" bordercolorlight="#000000" cellspacing="1" cellpadding="3" bordercolordark="#FFFFFF" bgcolor="#FFCCCC" align="center">
    <tr align="center" bgcolor="#ffeeee"> 
      <td nowrap colspan="2" height="25">发送短消息 </td>
    </tr>
    <tr> 
      <td bgcolor="#ffeeee" width="65" nowrap align="center">接收对象</td>
      <td bgcolor="#fff7f7"> 
<%Set conn = Server.CreateObject("ADODB.Connection")
DBPath = Server.MapPath("../isi/xlist.asp")
conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPath
Set rs_online = Server.CreateObject("ADODB.Recordset")
rs_online.open "select * from online",conn,1,1
if rs_online.recordcount=0 then%>
没有其他会员在线
<%else
   Set rs_hs = Server.CreateObject("ADODB.Recordset")%>
   <select class="put" name="to" size="1" class="put">   
   <%do while not(rs_online.eof)   
      sql="select user_name from user_reg where user_id=" & rs_online("user_id")
      rs_hs.open sql,conn,1,1
      if rs_hs.recordcount<>0 then%>
      <OPTION value=<%=rs_hs("user_name")%>><%=rs_hs("user_name")%></OPTION>                  
      <%end if
      rs_online.movenext
      rs_hs.close
      loop%>
   </select>   
<%end if%>
        <input  type=hidden name=myself value=<%=UserName%> size="20">
      </td>
    </tr>
    <tr> 
      <td bgcolor="#ffeeee" width="65" align="center"> 发送内容</td>
      <td bgcolor="#fff7f7"> 
        <input type=text name=message size=25 maxlength=100 class="put">
      </td>
    </tr>
    <tr align="center" bgcolor="#FFFFFF"> 
      <td colspan="2"> 
        <input type="submit" name=submit1 value=" 发送 " class="put1">&nbsp;&nbsp;
        <input type="reset" value=" 取消 " name="B2" class="put1">
      </td>
    </tr>
  </table>
</form>    
<script language="javascript">  
<!--  
saysfocus();  
-->  
</script>
</body>  
</html>  
<%end if%>

⌨️ 快捷键说明

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