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

📄 add.asp

📁 ASP入门与提高实用教程 源文件(上传网站)
💻 ASP
字号:
<%Response.Buffer=True%>
<!--#Include file="conn.asp"-->

<%
Dim title,text,strname,email
title=Request.Form("title")
text=Request.Form("text")
strname=Request.Form("name") 
email=Request.Form("email") 

'当标题,内容和留言人姓名都不为空时,执行以下语句
If title<>"" and text<>"" and strname<>"" Then

Dim strSql,strValues
strSql = "Insert Into subtab(subname"
strValues = "Values('" & strname & "'"
strSql = strSql & ",title"
strValues = strValues & ",'" & title & "'"
strSql = strSql & ",text"
strValues = strValues & ",'" & text & "'"


'如果留言人email不为空,则添加email
If email<>"" Then                           
  strSql = strSql & ",email"
  strValues = strValues & ",'" & email & "'"
End If

'插入系统时间为留言时间
strSql = strSql & ",subdate"
strValues = strValues & ",'" & date & "'"            
strSql = strSql & ") " & strValues & ")"

'插入记录
conn.Execute(strSql)

'关闭connection对象
conn.Close 

'重定向回首页                                 
Response.Redirect "index.asp" 

Else

'如果标题,内容和留言人姓名任意一个字段为空时,返回首页重新填写
Response.Write "<p align='center'><font size=-1><a href='index.asp'>请将信息填写完毕!</a></font></p>"
End If                
%>

⌨️ 快捷键说明

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