?? addxinxichk.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"> <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 + -