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

📄 addxinxichk.asp

📁 一套现成的分类信息网站发布系统
💻 ASP
字号:
<!--#include file=conn1.asp-->
<!--#include file=usercookies.asp-->
<!--#include file="config.asp"-->

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><%=title%>-信息发布</title>
<link href="inc_style.css" rel="stylesheet" type="text/css">
</head>
<body>
<!--#include file=top.asp-->
<div align="center">
<table border="0" cellpadding="0" style="border-collapse: collapse" bordercolor="#111111" width="768" height="85" bgcolor="#FFFFFF">
<tr>
<td width="157" height="85" valign="top"><br>
<!--#include file=userleft.asp--></td>
<td width="603" height="85" valign="top" align="left">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" height="83">
<tr>
<td width="100%" valign="top" height="83"> 
<!--#include file="err.asp"-->
<%
function chkcnmai(char) 
if instr(char,"'") then 
call errcnmai(13)
response.end 
end if
if instr(char,"|") then
call errcnmai(13)
response.end 
end if
if instr(char,"<") then
call errcnmai(13)
response.end 
end if
if instr(char,">") then
call errcnmai(13)
response.end 
end if
if instr(char,"&") then
call errcnmai(13)
response.end 
end if
if instr(char,"%") then
call errcnmai(13)
response.end 
end if
if instr(char,";") then
call errcnmai(13)
response.end 
end if
if instr(char,"$") then
call errcnmai(13)
response.end 
end if
end function
function IsValidEmail(email)
dim names, name,i,c
IsValidEmail = true
names = Split(email, "@")
if UBound(names) <> 1 then
   IsValidEmail = false
   exit function
end if
for each name in names
   if Len(name) <= 0 then
     IsValidEmail = false
     exit function
   end if
   for i = 1 to Len(name)
     c = Lcase(Mid(name, i, 1))
     if InStr("abcdefghijklmnopqrstuvwxyz_-.", c) <= 0 and not IsNumeric(c) then
       IsValidEmail = false
       exit function
     end if
   next
   if Left(name, 1) = "." or Right(name, 1) = "." then
      IsValidEmail = false
      exit function
   end if
next
if InStr(names(1), ".") <= 0 then
   IsValidEmail = false
   exit function
end if
i = Len(names(1)) - InStrRev(names(1), ".")
if i <> 2 and i <> 3 then
   IsValidEmail = false
   exit function
end if
if InStr(email, "..") > 0 then
   IsValidEmail = false
end if
end function
dim rs,sql,class1,class2,biaoti,jiage,diqu,memo,a,b,c,d,username,userip,id,sdays
if session("addxinxi")<>"" then
  if DateDiff("s",session("addxinxi"),Now())<10 then
  response.write "<li>系统保护:你提交数据太快,系统中止运行,请等待10秒钟!"
  response.end
  end if
end if
username=request.cookies("cnmai")("username")
class1=trim(request("class1"))
class2=trim(request("class2"))
biaoti=trim(request("biaoti"))
jiage=trim(request("jiage"))
diqu=trim(request("diqu"))
memo=trim(request("memo"))
a=trim(request("a"))
b=trim(request("b"))
c=trim(request("c"))
d=trim(request("d"))
sdays=trim(request("days"))
if class1="0" or class1="" then
errcnmai(10)
response.end
end if
if class2="0" or class2="" then
errcnmai(11)
response.end
end if
chkcnmai(biaoti)
if len(biaoti)>40 then
errcnmai(21)
response.end
end if
if IsValidEmail(trim(request("email")))=false then
errcnmai(19)
response.end
end if
set rs=server.createobject("adodb.recordset")
sql = "select * from [user] where username='"&username&"'"
rs.open sql,conn,1,3
rs("jf")=rs("jf")+jf_3
if len(a)=6 then
  if rs("a")<1 then
  errcnmai(25)
  response.end
  end if
rs("a")=rs("a")-1
end if
if b="" or b="0" then
b=0
else
  if rs("b")<int(b) then
  errcnmai(26)
  response.end
  end if
rs("b")=rs("b")-int(b)
end if
if c="1" then
  if rs("c")<1 then
  errcnmai(27)
  response.end
  end if
rs("c")=rs("c")-1
end if
if d="1"then
  if rs("d")<1 then
  errcnmai(28)
  response.end
  end if
rs("d")=rs("d")-1
end if
rs.update
rs.close
set rs=nothing
set rs=server.createobject("adodb.recordset")
sql = "select * from xinxi"
rs.open sql,conn,1,3
rs.addnew
rs("username")=username
rs("class1")=class1
rs("class2")=class2
rs("biaoti")=biaoti
rs("leixing")=request("leixing")
rs("jiage")=jiage
rs("diqu")=diqu
rs("memo")=memo
rs("name")=trim(request("name"))
rs("email")=trim(request("email"))
rs("dianhua")=trim(request("dianhua"))
rs("qq")=trim(request("qq"))
rs("dizhi")=trim(request("dizhi"))
if request("a")="" then
rs("a")=0
else
rs("a")=trim(request("a"))
end if
if request("b")="" then
rs("b")=0
else
rs("b")=trim(request("b"))
end if
if request("c")="" then
rs("c")=0
else
rs("c")=trim(request("c"))
end if
if request("d")="0" or request("d")="" then
rs("yz")=0 '换成"0",并对应将下下一行"0"换成1,将不需要审核功能就可以通过
else
rs("yz")=1 '与上对应
end if
rs("fbsj")=now()
rs("dqsj")= dateadd("d", sdays, now)
userip=Request.ServerVariables("HTTP_X_FORWARDED_FOR")
If userip="" Then 
userip=Request.ServerVariables("REMOTE_ADDR")
end if
rs("ip")=userip
rs.update
session("addxinxi")=now()
id=rs("id")
rs.close
set rs=nothing
closedb
if c="1" then
uptu
end if
if d="1" then
response.write "<p align=""center"">恭喜,您的信息已经发布成功!...</p>"
else
response.write "<p align=""center"">恭喜,您的信息已经发布成功!但您没有选用<b>[通过验证]</b>道具将将需审核才可以显示</p>"
end if
if c<>"1" then
response.write "<meta http-equiv=refresh content=""3;URL=index.asp"">"
end if
%>
<%sub uptu()%>
<p align="center">你使用了<b><font color="#FF0000">贴图道具</font></b>,请在这里上传图片(gif,jpg)
,图片大小:100 KB
<form name="form1" method="post" action="upfile.asp" enctype="multipart/form-data" >
<input type="hidden" name="id" value="<%=id%>">
<p align="center">
<input type="file" name="file1" value="" size="26">&nbsp; <input type="submit" value="提交" name="B1"></p>
</form>
<%end sub%>          
</td>
</tr>
</table>
</td>
</tr>
<!--#include file=end.htm-->
</table>
</div>
</body>
</html>

⌨️ 快捷键说明

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