求网页制作:制作留言板的代码

2024-12-17 16:40:59
推荐回答(1个)
回答1:


<%
dim name,qq,email,sex,liuyan,ly_type,ip,riqi
name=request("ly_user_name")
qq=request("ly_user_qq")
email=request("ly_user_email")
sex=request("ly_sex")
liuyan=request("ly_liuyan")
ly_type=request("ly_type")
ip=request.ServerVariables("REMOTE_ADDR")

if name="" then
response.write ""
elseif qq="" then
response.write ""
elseif liuyan="" then
response.write ""

else
if ly_type="" then
ly_type=1
else
ly_type=2
end if

dim sql

sql="insert into liuyan(ly_user_name,ly_user_qq,ly_user_email,ly_sex,ly_liuyan,ly_type,ly_user_ip,ly_user_riqi) values('" & name & "','" & qq & "','" & email & "','" & sex & "','" & liuyan & "','" & ly_type & "','" & ip & "',#" & date() & "#)"
db.execute(sql)

response.redirect "ly_main.asp"
end if
%>