add.asp
来自「电脑技术精华大全-共77册-507M.zip」· ASP 代码 · 共 96 行
ASP
96 行
<%Response.Buffer = True%>
<!--#include file="inc/dbconn.asp"-->
<%
name=request("name")
email=request("email")
homepage=request("homepage")
oicq=request("oicq")
pic=request("pic")
subject=request("subject")
main=request("main")
sex=request("sex")
fromto=request("fromto")
icq=request("icq")
Function Deal(exp1)
dim exp2
exp2=Replace(exp1,"<","<")
exp2=Replace(exp2,">",">")
exp2=Replace(exp2,"'","''")
exp2=Replace(exp2,Chr(13),"<br>")
Deal=exp2
End Function
if icq="" then
icq="还没有呢"
else
icq=request("icq")
end if
if fromto="" then
fromto="来自于天堂"
else
fromto=request("fromto")
end if
if sex="" then
sex="nosex"
else
sex=Request("sex")
sex=Deal(sex)
end if
if email="" then
email="不告诉你"
else
email=Request("email")
email=Deal(email)
end if
if homepage="" then
homepage="还没做呢"
else
homepage=Request("homepage")
homepage=Deal(homepage)
end if
if oicq="" then
oicq="写信问我"
else
oicq=request("oicq")
end if
if main="" then
main=""
else
main=Request("main")
main=Deal(main)
end if
%>
<%
set rs=server.createobject("adodb.recordset")
sql="select * from 留言本 where (id is null)"
rs.open sql,conn,1,3
rs.addnew
rs("姓名")=name
rs("电子邮件")=email
rs("个人主页")=homepage
rs("type")=Request("HTTP_USER_AGENT")
rs("ip")=Request("REMOTE_ADDR")
rs("fromto")=fromto
rs("sex")=sex
rs("icq")=icq
rs("oicq")=oicq
rs("表情")=pic
rs("留言主题")=subject
rs("留言内容")=main
rs.update
rs.close
set rs=nothing
conn.close
set conn=nothing
response.redirect "index.asp"%>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?