insertboard.asp

来自「大家好」· ASP 代码 · 共 37 行

ASP
37
字号
<%@ language="vbscript" %>
<%if request("boardname")="" or request("aboutboard")="" or request("webmaster")="" or request("password")=""  then
response.write "填完所有空格!<a href='newboard.htm'>返回</a>"
response.end
elseif trim(request("password"))<>"music" or trim(request("webmaster"))<>"mingming" then
response.write "密码不对!<a href='newboard.htm'>返回</a>"
response.end
end if

  DbPath = SERVER.MapPath("db1.mdb")
   Set conn = Server.CreateObject("ADODB.Connection")
   conn.open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DbPath
   if request("boardgg")="" and request("boardmm")="" then
  sql="insert into board_info (boardname,aboutboard) values('"&trim(request("boardname"))&"','"&trim(request("aboutboard"))&"')"
  elseif request("boardgg")="" and request("boardmm")<>"" then
  sql="insert into board_info (boardname,boardmm,aboutboard) values('"&trim(request("boardname"))&"','"&trim(request("boardmm"))&"','"&trim(request("aboutboard"))&"')"
  elseif request("boardmm")="" and request("boardgg")<>"" then
  sql="insert into board_info (boardname,boardgg,aboutboard) values('"&trim(request("boardname"))&"','"&trim(request("boardgg"))&"','"&trim(request("aboutboard"))&"')"
  else 
  sql="insert into board_info (boardname,boardgg,boardmm,aboutboard) values('"&trim(request("boardname"))&"','"&trim(request("boardgg"))&"','"&trim(request("boardmm"))&"','"&trim(request("aboutboard"))&"')"
  end if
  conn.execute sql
conn.close  
set conn=nothing
response.write "加班成功!:)<a href='changeboard.htm'>返回</a>"

%>
<html>

<head>
<title></title>
</head>

<body>
</body>
</html>

⌨️ 快捷键说明

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