日期:2014-05-16 浏览次数:20833 次
<!--#include file="conn2.asp"-->
<%
dim name,cards,phone,time,network,level,rs
Name=htmlencode(request.form("Name"))
cards=htmlencode(request.form("cards"))
phone=htmlencode(request.form("phone"))
time=htmlencode(request.form("time"))
network=htmlencode(request.form("network"))
level=htmlencode(request.form("level"))
If name="" or cards="" or phone="" then
Response.Write "<script>alert('持卡人、卡号,电话不能为空!');this.location.href='vbscript:history.back()';;</SCRIPT>"
ElseIf len(Name)>5 or len(cards)<21 then
Response.Write "<script>alert('持卡人、卡号输入错误!');this.location.href='vbscript:history.back()';</SCRIPT>"
ElseIf len(cards)<21 or len(phone)>13 or len(time)>40 or len(network)>40 then
Response.Write "<script>alert('卡号必须是19位!、联系电话、必须填写!');this.location.href='vbscript:history.back()';</SCRIPT>"
ElseIf len(time)>100 then
Response.Write "<script>alert('申请日期不要大于100个字符!');this.location.href='vbscript:history.back()';</SCRIPT>"
ElseIf len(level)>400 then
Response.Write "<script>alert('其它资料不要大于400个字符!');this.location.href='vbscript:history.back()';</SCRIPT>"
Else
Set Rs= Server.CreateObject("adodb.recordSet")
Rs.open "Select * from data", conn, 1, 3
Rs.addnew
Rs("Name") = Name
Rs("cards") = cards
Rs("phone") = phone
Rs("network") = network
Rs("time") = time
Rs("level") = level
Rs("ip") = request.serverVariables("remote_host")
Rs.update
Rs.close
Set Rs = nothing
Response.Write "<script>alert('VIP卡申请成功');this.location.href='add.asp';</SCRIPT>"
Response.End
End If
closedb
%>