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

📄 bbswriteok.asp

📁 用ASP写的二手市场程序
💻 ASP
字号:
<% language="VBSCRIPT" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title></title>

<link rel="stylesheet" type="text/css" href="new.css">
</head>
<body>      
<p> </p>
<p> </p>
  <table  cellspacing="0" cellpadding="0" border="1"  width="45%" height="30%" align="center" bordercolor="#cccccc">
<tr><td bgcolor="#f7f3f7" >
<table align="center"><tr><td>

<%
Connstr = "DBQ="+server.mappath("bbs.mdb")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.open Connstr

strq="select * from BBS_USER where nickname='" & request("nickname") & "'"

Set RS=Conn.execute(strq)
if RS.EOF then 
  strq="insert into BBS_USER (nickname,passwd,settime) values ('"
  strq=strq & request("nickname") & "','"
rem   strq=strq & request("password") & "',getDate())"  
  strq=strq & request("password") & "',date()+time())"
  Conn.Execute strq,HowMany,&H0001
  if HowMany<1 then 
    response.write "没有注册成功,请与<a href='mailto:erso@yeah.net'>系统管理员</a>联系!"%>
<br><br><p align='center'><input type='button' value='确定' style='font-size=9pt ; width=60'  onclick=location.href='javascript:history.go(-1)' name='B3'></p>
<%
    RS.close
    Set RS=nothing
    Conn.close
    set Conn=nothing
%>

</td></tr></table>
</td></tr></table>
<!--#include file="adv.htm"-->  

<!--#include file="../_borders/bottom.htm"--> </body>
</HTML>

<%
response.end

  else
%>
<center>新用户:
<FONT color=#336600><I><%=request("nickname")%></I></FONT>
成功注册!请记住您的口令!<BR><BR></center>
<%
  end if
else
  if RS("passwd")<>request("password") then 
%>
<center>错 误!<br><br>
用户名&nbsp;<FONT color=#336600><I><%=request("nickname")%></I></FONT>&nbsp;已经注册!&nbsp;用户口令错误!</FONT></center>
<br><br><p align='center'><input type='button' value='确定' style='font-size=9pt ; width=60'  onclick=location.href='javascript:history.go(-1)' name='B3'></p>
<%
    RS.close
    Set RS=nothing
    Conn.close
    set Conn=nothing
%>

</td></tr></table>
</td></tr></table>
<!--#include file="adv.htm"-->  

<!--#include file="../_borders/bottom.htm"--> </body>
</HTML>

<%
    response.end
  end if
end if

if request("edittype")="N" then 
	set RS=Conn.execute("select max(sortnum1) from BBS_TABLE where msgtype=0")
	If  RS.EOF then 
	  MaxNum=2
	Else
	  MaxNum=RS(0)
	End if




	strq="*" & MaxNum & "*"
	if strq="**" then MaxNum=0

	strq="insert into BBS_TABLE (posttime,poster,posterIP,"
	strq=strq & "title,email,icq,oicq,face,msglevel,msgtype,clicktime,sortnum1,sortnum2,information)"
rem	strq=strq & " values (getDate(),'" 
	strq=strq & " values (date()+time(),'" 
	strq=strq & request("nickname") & "','"
	strq=strq & request.ServerVariables("Remote_Addr") & "','"
	strq=strq & request("title") & "','"
	strq=strq & request("email") & "','"
	strq=strq & request("icq") & "','"
        strq=strq & request("oicq") & "',"
	strq=strq & request("faces") & ",0,0"
	strq=strq & ",0,"
	strq=strq & MaxNum+4 & ","
	strq=strq & MaxNum & ",'"
	strq=strq & replace(request("content"),"'","`") & "')"
rem 	response.write strq
	Conn.Execute strq,HowMany,&H0001
    if HowMany<1 then 
     response.write ("写入失败!<br><br><center><a href='javascript: history.back()'>返回</a></center>")
    else
%>

<center><FONT  color=#336600><%=request("nickname")%></FONT> 的文章<FONT color="#660099">《<%=request("title")%>》</FONT>已经成功写入!</center>

<%
   response.write "<meta http-equiv='refresh' content='2; url=bbs.asp'>"
    end if
else
	set RS=Conn.execute("select sortnum1,sortnum2 from BBS_TABLE where msgID=" & request("mid"))
	If  RS.EOF then 
	  NextSort=0
	  LinkSort=0
	Else
	  NextSort=(RS("sortnum1")+RS("sortnum2"))/2
	  LinkSort=RS("sortnum2")
	End if

	strq="update BBS_TABLE set sortnum2=" & NextSort
	strq=strq & " where msgID=" & request("mid")
rem  	response.write strq
	Conn.Execute strq,HowMany,&H0001
    if HowMany<1 then 
      response.write "<center>错误,请与<a href='mailto:erso@yeah.net'>系统管理员</a>联系!<br><br><center><a href='javascript: history.back()'>返回</a></center>"
      RS.close
      Set RS=nothing
      Conn.close
      set Conn=nothing
%>

</td></tr></table>
</td></tr></table>
<!--#include file="adv.htm"-->  

<!--#include file="../_borders/bottom.htm"--> </body>
</HTML>

<%
    response.end
    end if

	strq="insert into BBS_TABLE (posttime,poster,posterIP,"
	strq=strq & "title,email,icq,oicq,face,msglevel,msgtype,clicktime,sortnum1,sortnum2,information)"
rem 	strq=strq & " values (getDate(),'" 
 	strq=strq & " values (date()+time(),'" 
	strq=strq & request("nickname") & "','"
	strq=strq & request.ServerVariables("Remote_Addr") & "','"
	strq=strq & request("title") & "','"
	strq=strq & request("email") & "','"
	strq=strq & request("icq") & "','"
        strq=strq & request("oicq") & "',"
	strq=strq & request("faces") & ","
	strq=strq & request("prelevel")+1 & ",0,0,"
	strq=strq & NextSort & ","
	strq=strq & LinkSort & ",'"
	strq=strq & replace(request("content"),"'","`") & "')"
rem 	response.write strq
	Conn.Execute strq,HowMany,&H0001
    if HowMany<1 then 
     response.write ("写入失败!<br><br><center><a href='javascript: history.back()'>返回</a></center>")
    else
%>

<center><FONT  color=#336600><%=request("nickname")%></FONT> 的文章<FONT color="#660099">《<%=request("title")%>》</FONT>已经成功写入!</center>
<%
   response.write "<meta http-equiv='refresh' content='2; url=bbs.asp'>"
    end if

end if

RS.close
Set RS=nothing
Conn.close
set Conn=nothing
%>

</td></tr></table>
</td></tr></table>

<!--#include file="adv.htm"-->  


</body>
</html>

⌨️ 快捷键说明

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