add.asp

来自「ASP,版本,HUANYING NI DE XIAZAI ! LIANXIFAN」· ASP 代码 · 共 47 行

ASP
47
字号

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>add.asp</title>
</head>

<body>
		
		<%
			If Request.Form("username")<>"" And Request.Form("password")<>""_
			 And Request.Form("name")<>""  and Request.Form("sex")<>""  and Request.Form("adress")<>""_
			 and Request.Form("email")<>""  and Request.Form("postalcode")<>"" and Request.Form("fax")<>""_
			 and Request.Form("tel")<>"" then
			 
			 Dim db 
			 Set db=Server.CreateObject("ADODB.Connection") 
			 db.Open "Dbq="&Server.Mappath("database/xingxing.mdb")&";Driver={Microsoft Access Driver (*.mdb)};" 
			 
			 
			 Dim strSql,varUsername,varPassword,varName,verSex,verAdress,verEmail,verPostalcode,verFax,verTel
			 	varUsername=Request.Form("username") 
			 	varPassword=Request.Form("password") 
				varName=Request.Form("name")
				verSex=Request.Form("sex")
				verAdress=Request.Form("adress")
				verEmail=Request.Form("email")
				verPostalcode=Request.Form("postalcode")
				verFax=Request.Form("fax")
				verTel=Request.Form("tel")
				
				strSql="Insert Into user(username,password,usertype,name,sex,tel,fax,adress,email,postalcode,regdate,entnum,dum,cumulation,toolA,toolB,toolC) Values('" & varUsername & "','" & varPassword & "',"& 1 &",'" & varName & "','" & verSex & "','" & verTel & "','" & verFax & "','" & verAdress & "','" & verEmail & "','" & verPostalcode & "',#" & now() & "#,"& 0 &","& 10 &","& 10 &","& 10 &","& 10 &","& 10 &")"  
				db.Execute(strSql)               
				Response.Redirect "index.asp" 
				
				 Else
				Response.Write "请将所有信息填写完整,"
				Response.Write "<a href='reg.asp'>重新添加</a>"
				End If
				
		
		%>

</body>
</html>

⌨️ 快捷键说明

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