?? addbk2.asp
字號:
<!--#include file=conn.asp-->
<%
dim name,pic1,pic2,pic3,intro,cintro,question1,question2,question3,message,sql,count,answer1,answer2,answer3
count=0
name=trim(request("name"))
forename=trim(request("forename"))
pic1=trim(request("pic1"))
pic2=trim(request("pic2"))
pic3=trim(request("pic3"))
intro=request("intro")
if intro="" then intro="沒有簡介!"
cintro=trim(request("cintro"))
if cintro="" then cintro="沒有詳細介紹!"
question1=trim(request("question1"))
if question1="" then question1=" "
question2=trim(request("question2"))
if question2="" then question2=" "
answer1=trim(request("answer1"))
if answer1="" then answer1=" "
answer2=trim(request("answer2"))
if answer2="" then answer2=" "
answer3=trim(request("answer3"))
if answer3="" then answer3=" "
question3=trim(request("question3"))
if question3="" then question3=" "
pic4=trim(request("pic4"))
if pic1="" then pic1=" "
if pic2="" then pic2=" "
if pic3="" then pic3=" "
if pic4="" then pic4=" "
if name<>"" then
sql="select * from bclass where name='"&name&"'"
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1,1
if not rs.eof and bof then count=count+1
rs.close
if count>0 then
message="對不起,此大類已經存在!"
else
sql="insert into bclass(name,pic1,pic2,pic3,pic4,intro,cintro,question1,question2,question3,answer1,answer2,answer3)values('"&name&"','"&pic1&"','"&pic2&"','"&pic3&"','"&pic4&"','"&intro&"','"&cintro&"','"&question1&"','"&question2&"','"&question3&"','"&answer1&"','"&answer2&"','"&answer3&"')"
conn.execute(sql)
message="成功加入!"
end if
else
message="你的某個輸入為空!"&name&pic1&pic2&pic3&pic4&intro&cintro&question1&question2&question3&message&count
end if
response.redirect"addbk.asp?message="&message
%>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -