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

📄 gbwrite.asp

📁 柠檬树聊天服务器
💻 ASP
字号:
<%Response.Expires=0
class1=Session("class")
if class1="" then Response.Write "没有权限" : Response.end
n=Year(date())
y=Month(date())
r=Day(date())
s=Hour(time())
f=Minute(time())
m=Second(time())
if len(y)=1 then y="0" & y
if len(r)=1 then r="0" & r
if len(s)=1 then s="0" & s
if len(f)=1 then f="0" & f
if len(m)=1 then m="0" & m
sj=n & "-" & y & "-" & r & " " & s & ":" & f & ":" & m

method=Request.ServerVariables("Request_method")
IF method="GET" then
title=Request.QueryString("title")
towho=Request.QueryString("towho")
Else
towho=Request.Form("towho")
towho=server.HTMLEncode(towho)
IF towho="" then towho=" "
mm=Request.Form("mm")
IF mm="" then mm=" "
title=Request.Form("title")
title=server.HTMLEncode(title)
IF title="" then title=" "
detail=Request.Form("detail")
detail=server.HTMLEncode(detail)
IF detail="" then detail=" "
fromwho=Request.Form("fromwho")
fromwho=server.HTMLEncode(fromwho)
password=Request.Form("pass")

Dim temppass,templen,mmnewpass,j

 temppass=StrReverse(password)
 templen=len(password)
 mmnewpass=""
 for j=1 to templen
  mmnewpass=mmnewpass+chr(asc(mid(temppass,j,1))-templen+int(j*1.1))
 next
password=mmnewpass
email=Request.Form("email")
email=server.HTMLEncode(email)
IF email="" then email=" "
homepage=Request.Form("homepage")
homepage=server.HTMLEncode(homepage)
IF homepage="" then homepage=" "
homeurl=Request.Form("homeurl")
homeurl=server.HTMLEncode(homeurl)
IF homeurl="" then homeurl=" "
End if
%>

<html>
<head>
<title>网友留言</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<script language="JavaScript">
function check(){if(document.forms[0].title.value==""||document.forms[0].detail.value==""||document.forms[0].fromwho.value==""){alert("请将红色项目填写完整!");return false;}document.forms[0].Submit.disabled=1;return true;}
</script>
<style type="text/css">
td{font-size:9pt}
body{font-size:10.5pt}
input{font-size:9pt}
</style>
</head>
<body oncontextmenu=self.event.returnValue=false bgcolor="#DBEEB5">
<br><br>
<%IF method="GET" then%>
<table border="1" cellspacing="0" bordercolorlight="#000000" bordercolordark="#FFFFFF" align="center" bgcolor="#eeeeee" cellpadding="8">
<form method="post" action="gbwrite.asp" onsubmit='return(check());'>
<tr align="center">
<td> 
<table width="100%" border="0">
<tr> 
<td>写给:</td>
<td> 
<input type="text" name="towho" maxlength="20" value=<%=towho%>>
<input type="checkbox" name="mm" value="1">悄悄话 [<font color=red>红色为必填部分</font>]</td>
</tr>
<tr> 
<td><font color="#FF0000">主题:</font></td>
<td> 
<input type="text" name="title" size="48" maxlength="48" value=<%=title%>>
</td>
</tr>
<tr>
<td><font color="#FF0000">内容:</font></td>
<td>
<textarea name="detail" cols="40" rows="8"></textarea>
</td>
</tr>
</table>
<hr>

<table width="100%" border="0">
<tr> 
<td><font color="#FF0000">姓名:</font></td>
<td> 
<input type="text" name="fromwho" maxlength="20" value=<%=Session("usernickname")%>>
<font color="#FF0000">密码:</font>
<input type="password" name="pass" size="10" maxlength="10">
</td>
</tr>

<tr> 
<td>E-Mail:</td>
<td> 
<input type="text" name="email" maxlength="50">
</td>
</tr>
<tr> 
<td>主页名称</td>
<td><input type="text" name="homepage" size="32" maxlength="24">
</td>
<tr>
<td>
主页地址</td><td><input type="text" name="homeurl" value="http://" size="32" maxlength="50">
</td>
</tr>
</table>
<hr>
<table>
<tr align="center"> 
<td >
<input type="submit" name="Submit" value="--提--交--" style="background-color: FFCCFF">
<input type="reset" value="--重--写--" style="background-color: FFCCFF">
<input type="button" value="--放--弃--" style="background-color: FFCCFF" onclick="javascript:history.go(-1)">
</td>
</tr>
</table>
</td>
</tr>
</form>
</table>
<%ELSE%>
<!--#include file="conn.asp"-->
<%
  Set rs = Conn.Execute("select userpassword from Chatuser where username='"&fromwho&"'")

  IF rs.eof then
   Response.Write "<title>错误提示 - 柠檬树聊天室</title>"
   Response.write "<body bgcolor=#DBEEB5><p>&nbsp;</p><p align='center'><font color=#FF0000> "&fromwho&"</font> 是未注册用户,不能留言</p>"
   Response.write "<p align='center'><a href='javascript:history.go(-1);'>点击这里返回</a></p></body>"
   Response.end
  end if

  IF password<>rs("userpassword") then
   Response.Write "<title>错误提示 - 柠檬树聊天室</title>"
   Response.write "<body bgcolor=#DBEEB5><p>&nbsp;</p><p align='center'><font color=#FF0000>你的用户名和密码不符!</font></p>"
   Response.write "<p align='center'><a href='javascript:history.go(-1);'>点击这里返回</a></p></body>"
   Response.end
  end if
  Set rs1 = Conn.Execute("insert into board (time1,fromwho,towho,title,private,mail,url,urlname,detail) Values('"&sj&"','"&fromwho&"','"&towho&"','"&title&"','"&mm&"','"&email&"','"&homepage&"','"&homeurl&"','"&detail&"')")
  rs1.close
  rs.Close
  
 Response.Write "<title>留言已送出 - 柠檬树聊天室</title>"
 Response.write "<body bgcolor=#DBEEB5><p>&nbsp;</p><p align='center'><font color=#FF0000>留言已送出!</font></p>"
 Response.write "<p align='center'><a href='javascript:history.go(-1);'>点击这里返回</a></p></body>"
 Response.end
END IF%>

</body>
</html>

⌨️ 快捷键说明

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