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

📄 guest_input.asp

📁 主要功能如下:1、不用注册也可以发言
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<%@language=vbscript codepage=936 %>
<!--#INCLUDE FILE="config.asp"-->
<!--#INCLUDE FILE="background.asp"-->
<!--#INCLUDE FILE="md5.asp"-->
<!--#INCLUDE FILE="ubbcode.asp"-->
<!--#INCLUDE FILE="ubblabel.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>写新讨论</title>
<link href="1.css" rel="stylesheet" type="text/css">
</head>
  <SCRIPT language=javascript>
function  save_onclick()
{
  document.form.Content.value=editor.HtmlEdit.document.body.innerHTML; 
  var strTemp = document.form.subject.value;
  if (strTemp.length == 0 )
  {
      alert("请输入讨论标题!");
      document.form.subject.focus();
      return false;
  }
  var strTemp = document.form.UserName.value;
  if (strTemp.length == 0 )
  {
      alert("请输入用户名!");
      document.form.UserName.focus();
      return false;
  }
  var strTemp = document.form.Content.value;
  if (strTemp.length == 0 )
  {
      alert("请填写讨论内容!");
      return false;
  }
  return true;
}
function  save_onclick1()
{
  var strTemp = document.form.subject.value;
  if (strTemp.length == 0 )
  {
      alert("请输入讨论标题!");
      document.form.subject.focus();
      return false;
  }
  var strTemp = document.form.UserName.value;
  if (strTemp.length == 0 )
  {
      alert("请输入用户名!");
      document.form.UserName.focus();
      return false;
  }
  var strTemp = document.form.Content.value;
  if (strTemp.length == 0 )
  {
      alert("请填写讨论内容!");
      return false;
  }
  return true;
}
function guestpreview()
{
document.preview.content.value=document.form.Content.value;
var popupWin = window.open('GuestPreview.asp', 'GuestPreview', 'scrollbars=yes,width=620,height=230');
document.preview.submit()
}
</SCRIPT>
<body onkeydown="if(event.keyCode==13 && event.ctrlKey) if(save_onclick1())document.form.submit()">
<%
session("useridname")=Request.cookies("ly")("useridname")
session("useridpassword")=Request.cookies("ly")("useridpassword")
session("admin")=Request.cookies("ly")("admin")
%>


<TABLE class=page cellSpacing=0 cellPadding=0 width=760 align=center border=0>
  <TBODY>
	  <TR>
    <TD>
<div align="center">
<!--#INCLUDE FILE="top.asp"-->
</div>

<%
if request.Form<>"" then
	 register=rs11("register")
     UserName=Trim(Request.Form("UserName"))
	 if UserName="" then response.Redirect "error.asp?info=请输入用户名!"
	 password=Trim(request.Form("password"))
	 Email=Trim(Request.Form("Email"))
     HomePage=Trim(Trim(Request.Form("HomePage")))
	 qq=Trim(request.Form("qq"))
	 sex=Request.Form("sex")
     Face=Trim(Request.Form("Face"))
     Subject=Trim(HTMLEncode(Request.Form("Subject")))
	 pic=Trim(request.Form("pic"))
	 secret=request.Form("secret")
	 fontcolor=Trim(request.Form("fontcolor"))
	 if secret<>1 then secret=0
     content=Request.Form("content")
	 if (rs11("lylength")<>0) and (strLength(UserName)>rs11("lylength")) then response.Redirect "error.asp?info=讨论长度大于"&rs11("lylength")&"个汉字!"
	dim strSiteUrl
	strSiteUrl=request.ServerVariables("HTTP_REFERER")
	strSiteUrl=lcase(left(strSiteUrl,instrrev(strSiteUrl,"/")))
	Content=replace(Content,strSiteUrl,"")
	 content=replace(content,"'","""")
	 if rs11("muieditor")=0 or rs11("muieditor")=2 then
		content=HTMLEncode(content)
	 end if
	 level=request.Form("level1")
	 IPinfo = Request.servervariables("REMOTE_ADDR")
     bookdate =now

if session("keeptime")="" then 
	session("keeptime")=now
else if (dateDiff("s",session("keeptime"),now)<=rs11("second1")) and ((session("admin")<>1) and (session("admin")<>2)) then 
	response.Redirect("error.asp?info=请不要灌水")
else session("keeptime")=now
end if
end if

Dim serchIP
Dim strB
strB=rs11("killIP")
if strB<>"" then 
	serchIP=Split(strB,",")
	for i=0 to ubound(serchIP)
		if IPinfo=serchIP(i) then response.Redirect "error.asp?info=系统已经禁止了你的发言!"
	next
end if

Dim arrayx
Dim strA
strtemp=content
strtemp1=Subject
strA=rs11("killword")
if strA<>"" then 
arrayx=Split(strA,",")
for i=0 to ubound(arrayx)
strtemp=replace(strtemp,arrayx(i),"***")
strtemp1=replace(strtemp1,arrayx(i),"***")
next
end if
if (strtemp<>content) or (strtemp1<>Subject) then
	if rs11("stopword") then
		rs11("killIP")=rs11("killIP")&","&IPinfo
		rs11.update
	end if
end if
content=strtemp
Subject=strtemp1

	 if homepage="http://" then homepage="" 
	 Set rs=server.createobject("ADODB.RECORDSET")
	  rs.open "Select * From register where username='" & request("username")& "'" ,Conn,3,3
	  if (username<>"") and (password<>"") and (not rs.eof) then
	  if (rs("username")=username) and (rs("password1")=md5(password)) then
	  	homepage=rs("homepage")
	  	Email=rs("mail")
		qq=rs("qq")
		rs("count1")=rs("count1")+1
		rs.update
	  end if
	  end if
      if (rs.eof) and (register) then response.Redirect("error.asp?info=未注册用户不能讨论")
	  if not (rs.eof or rs.bof) then 
	  	if rs("password1")<>md5(password) then response.Redirect "error.asp?info=用户名已注册,密码错误!" 
		rs.close    
	  else
	    rs.close
		if password<>"" then
		sql="Insert Into register (username,password1,mail,homepage,face,sex,count1,qq)  Values('"& UserName&"','"& md5(password)&"','"&email&"','"&homepage&"','"&face&"','"&sex&"',1,'"&qq&"')"
	  	conn.Execute sql
		cookiePath=request.servervariables("path_info")
		cookiePath=left(cookiePath,instrRev(cookiePath,"/"))
		response.cookies("ly").Path=cookiePath
		response.cookies("ly")("useridname")=username
		response.cookies("ly")("useridpassword")=password
		end if
	  end if
	  if (session("admin")=1) or (session("admin")=2) then
	  	mark=true
	  else
			 if (Instr(rs11("passuser"),","&UserName)>0) or (Instr(rs11("passuser"),","&UserName&",")>0) or (Instr(rs11("passuser"),","&UserName&",")>0) then
				mark=true
			 else
				mark=false
			 end if
	 end if
	 sql="Insert Into guest (username,face,sex,homepage,mail,subject,content,IP,lydate,lastdate,pic,secret,qq,lastname,mark,fontcolor)  Values('"& UserName &"','"& Face &"','"& sex &"','"& HomePage &"', '"& Email &"','"& Subject &"','"&content &"','"& IPinfo &"','"& bookdate &"','"& bookdate &"','"& pic &"',"& secret &",'"&qq&"','——',"&mark&",'"&fontcolor&"')"
	 conn.Execute sql
	 rs.open "Select * From guest order by id desc" ,Conn,1,1
	 id=rs("id")
	 rs.close
	 set rs=nothing
conn.close
set conn=nothing
	response.Redirect "guest_save_ok.asp?id="&id
end if
%>
<table border=0 width=760 cellspacing="0" cellpadding="2">
  <tr>
    <td width="3%" align=left class="tablebg<%=skin%>a"><font color="#FF0000">&nbsp;<img src="images/home.gif" border=0></font></td>
    <td width="8%" align=left class="tablebg<%=skin%>a"><a href="<%if session("list")=0 then%>default.asp<%else%>default1.asp<%end if%>">讨论首页</a></td>
    <td width="89%" align=right class="tablebg<%=skin%>a">
      <!--#INCLUDE FILE="link.asp"-->
    </td>
</table>
<form action="" method="POST" name="form" id="form" <%if rs11("muieditor")=1 then%>onsubmit="return save_onclick()"<%else%>onsubmit="return save_onclick1()"<%end if%>>
  <input type="hidden" name="form" value="SaveData">

⌨️ 快捷键说明

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