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

📄 insert.asp

📁 我是一名学生,最近一直在学生用ASP+SQL SERVER的数据库制作一个网站的会员登陆系统...我用的网页编辑工作是DW8,可以网上搜了好久都没有找到相关的教程...本人是十分想学习怎么制作一个这样
💻 ASP
字号:
<!--#INCLUDE FILE="odbc_connection.asp"-->
<html>
<head>
	<title>输入结果</title>
</head>
<body>
	<%
	If Trim(Request("name"))="" Or Trim(Request("password"))=""Then
		Response.Write "对不起,姓名和密码必须输入"
		Response.Write "<p><a href='add_form.htm'>返回,重新填写</a>"
	Else
		Dim name,password,tel,email,home,intro,handtel,ftype,web
		name=Request("name")
		password=Request("password")
		tel=Request("tel")
		home=request("home")
		email=request("email")
		intro=request("intro")
		handtel=request("handtel")
		ftype=request("ftype")
		web=request("web")
		'下面将数据填入数据库中
		On Error Resume Next
		'建立Connection对象
		'下面添加数据
		Dim strSql,sValues
		strSql = "Insert into users(name,password"
		sValues = "values('" & name & "','" & password & "'" 
		If tel<>"" Then
			strSql = strSql & ",tel"
			sValues = sValues & ",'" & tel & "'"
		End If
		If handtel<>"" Then
			strSql = strSql & ",handtel"
			sValues = sValues & ",'" & handtel & "'"
		End If
		If ftype<>"" Then
			strSql = strSql & ",ftype"
			sValues = sValues & ",'" & ftype & "'"
		End If
		If home<>"" Then
			strSql = strSql & ",home"
			sValues = sValues & ",'" & home & "'"
		End If
		If email<>"" Then
			strSql = strSql & ",email"
			sValues = sValues & ",'" & email & "'"
		End If
		If web<>"" Then
			strSql = strSql & ",web"
			sValues = sValues & ",'" & web & "'"
		End If
		If intro<>"" Then
			strSql = strSql & ",intro"
			sValues = sValues & ",'" & intro & "'"
		End If
		strSql = strSql & ") " & sValues & ")"
		db.Execute(strSql)                        '执行添加操作
		'下面判断插入过程有无错误,并给出相应信息
		If db.Errors.Count>0 Then
			Response.Write "保存过程中发生错误,必须重新填写"
			Response.Write "<p><a href='add_form.htm'>返回,重新填写</a>"
		Else
			Response.Write "<h2 align='center'>您的信息已经安全加入,请牢记密码</h2>"
			response.write "<center><table width='70%'><tr><td>"
			response.write "<p>姓名:" & name 
			response.write "<p>电话:" & tel 
			response.write "<p>手机:" & handtel 
			response.write "<p>email:" & email 
			response.write "<p>web:" & web 
			response.write "<p>住址:" & home 
			response.write "<p>简介:" & intro 
			response.write "<p>朋友类型:" & ftype 
			response.write "</td></tr></table>"
			Response.Write "<p><a href='index.asp' >谢谢,请您返回首页</a></center>"
		End If
	End If
	%>
</body>
</html>

⌨️ 快捷键说明

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