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

📄 addnew.asp

📁 ASP+SQL Server动态网站开发从基础到实践教程
💻 ASP
字号:
<!--#include file="connection.asp"-->
<%
if session("userid") = "" then
	Response.Redirect "login.htm"
end if
%>

<%
dim xtitle_name
xtitle_name = request("title_name")

if instr(1,xtitle_name,"'") > 0 then
	xtitle_name = replace(xtitle_name,"'","''")
end if


conn.open = connstring
set rs = Server.CreateObject("adodb.recordset")
rs.open "Select title_id from titles order by title_id desc",conn

xmax = 1
if not rs.EOF then
	xmax = rs.Fields("title_id") + 1
end if

set rs1 = Server.CreateObject("adodb.recordset")
rs1.open "insert into titles values(" & xmax & ",'" & xtitle_name & "',1)",conn 

Response.Redirect "main.asp?flag=added"
%>

⌨️ 快捷键说明

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