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

📄 sendmessage.asp

📁 旅游路线管理 比较方便的旅游路线管理
💻 ASP
字号:
<!--===============================================================-->
<!--Mfkiqpl旅行社旅游线路预订程序源代码仅供学习或部分旅行社网站用---->
<!--任何单位或个人不得随意修改、截取其中代码或做不法用途------------->
<!--版权归属:mfkiqpl   http://www.zjjnet.com 所有-------------------->
<!--请务必保留以下版权信息------------------------------------------->
<!--作者:mfkiqpl----------------------------------------------------->
<!--QQ:31827726 mail:mfkiqpl@126.com--------------------------------->
<!--主页地址:http://www.zjjnet.com----------------------------------->
<!----------------欢迎各位站长与本人小站进行友情链接----------------->
<!--===============================================================-->
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="conn.asp"-->
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<%
pagestart
%>
<script>
function ff(tt){
tt.focus();
}
function check(){
if(form1.username.value==''){
alert("您的姓名没有填写!");
form1.username.focus();
return false;
}
if(form1.msgtime.value==''){
alert("时间为默认服务器时间,请不要改动!");
form1.msgtime.focus();
return false;
}
if(form1.msgname.value==''){
alert("信息主题没有填写!");
form1.msgname.focus();
return false;
}
if(form1.msgtext.value==''){
alert("信息内容没有填写!");
form1.msgtext.focus();
return false;
}
if(form1.msgtext.value.length > 200){
alert("内容不能多于200字!");
return false;
}
}
function asdf(){
form1.textf.value=form1.msgtext.value.length
if(form1.textf.value>200){
alert("您已经写够200字了!再写下去您将无法发送成功!");
}
}
</script>
<%
dim action
action=trim(request("action"))
if action="ok" then
sendok
else
send
end if
sub sendok
dim username,msgname,msgtime,msgtext
username=replace(trim(request("username")),"'","")
msgname=replace(trim(request("msgname")),"'","")
msgtime=now()
msgtext=replace(trim(request("msgtext")),"'","")
sql="insert into message (username,msgname,msgtime,msgtext) values ('"&username&"','"&msgname&"','"&msgtime&"','"&msgtext&"')"
conn.execute(sql)
closeconn
session("user")=username
response.Redirect("ok.asp?msg=<li>您的本次操作:发站内短信</li><br><li>操作成功!感谢您对我们的支持!</li>")
end sub
sub send
%>
      <table width="755" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td width="40" height="22" align="center" bgcolor="<%=c3%>"><img src="images/mfk28.gif" width="19" height="18"></td>
          <td width="715" bgcolor="<%=c3%>">发站内短信</td>
        </tr>
      </table>
      <table width="755" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td height="4"></td>
        </tr>
      </table>
      <table width="755" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="<%=c1%>">
<form name="form1" method="post" action="sendmessage.asp?action=ok" onSubmit="return check();">
      <tr bgcolor="<%=c3%>">
        <td width="129" height="30" align="center">姓 名:</td>
        <td width="265" height="30" bgcolor="<%=c4%>"> 
          <input name="username" type="text" id="username" title=20字以内 onMouseOver="ff(this);" value="<%=session("user")%>" size="20" maxlength="20"></td>
        <td width="109" height="30" align="center">时 间:</td>
        <td width="247" height="30" bgcolor="<%=c4%>"> 
          <input name="msgtime" type="text" id="msgtime" size="20" onMouseOver="ff(this);" value=<%=date%>/<%=time%> title=系统默认当前时间></td>
      </tr>
      <tr bgcolor="<%=c3%>">
        <td height="30" align="center">主 题:</td>
        <td height="30" colspan="3" bgcolor="<%=c4%>"> 
          <input name="msgname" type="text" id="msgname" title=50字以内 onMouseOver="ff(this);" size="40" maxlength="50"></td>
    </tr>
      <tr bgcolor="<%=c3%>">
        <td height="102" align="center">内 容:</td>
        <td colspan="3" bgcolor="<%=c4%>"> 
          <textarea name="msgtext" cols="50" rows="5" id="msgtext" onMouseOver="ff(this);" title=200字以内 onKeyUp="asdf();" onKeyDown="asdf();"></textarea></td>
    </tr>
      <tr align="center" bgcolor="<%=c4%>">
        <td height="30" colspan="4"><input type="submit" name="Submit" value="发 送">   
          <input type="reset" name="Submit2" value="重 写">
            您已经写了:
          <input name="textf" type="text" id="textf" size="3">
        个字</td>
    </tr>
    </form>
    </table>
<table width=755 border=0 align=center cellpadding=0 cellspacing=0><tr><td height=4></td></tr></table>
      <table width="755" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td width="40" height="22" align="center" bgcolor="<%=c3%>"><img src="images/mfk29.gif" width="19" height="19"></td>
          <td width="715" bgcolor="<%=c3%>">短信记录
            <%if session("user")="" then%>
            (只有先发送,才能显示您历史上所发送的记录)
            <%else%>
            (以下是<%=session("user")%>发送过的短信记录)   <img src="images/mfk25.gif" width="12" height="12"> <a href="userlook.asp?action=logout">退出身份</a>
            <%end if%></td>
        </tr>
      </table>
<%if session("user")<>"" then
response.Write("<script>")
response.Write("function scolor(dd){dd.style.backgroundColor='#ffffff';}")
response.Write("function rcolor(tt){tt.style.backgroundColor='';}")
response.Write("</script>")
set rs=conn.execute("select * from message where username='"&session("user")&"'")
while not rs.eof
n=rs("msgname")
if len(n)>10 then
n=left(n,9)&".."
end if
t=rs("msgtext")
if len(t)>32 then
t=left(t,31)&".."
end if
response.write("<table width=""755"" border=""0"" align=""center"" cellpadding=""0"" cellspacing=""0""><tr>")
response.write("<td height=""4""></td></tr></table><table width=""755"" border=""0"" align=""center"" cellpadding=""0"" cellspacing=""0"">")
response.write("<tr>")
response.write("<td height=""22"" bgcolor="&c4&" style=""cursor:hand "" onMouseOver='scolor(this);' onMouseOut='rcolor(this);'> "&rs("username")&"  "&rs("msgtime")&"  <a title='"&mfkiqpl(rs("msgname"))&"'>"&n&"</a>  <a title='"&mfkiqpl(rs("msgtext"))&"'>"&t&"</a></td>")
response.write("</tr></table>")
rs.movenext
wend
end if
end sub
response.write("<table width='755' border='0' align='center' cellpadding='0' cellspacing='0'><tr><td height='5'></td></tr></table>")
pageend
%>

⌨️ 快捷键说明

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