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

📄 reg_company_sav.asp

📁 oracle9i程序事例集
💻 ASP
字号:
<%@LANGUAGE="VBSCRIPT"%>
<%
  dim conn
  dim connstr
  Set conn=Server.CreateObject("ADODB.Recordset")
  connstr="Driver={Microsoft ODBC for Oracle};server=mylink;uid=system;pwd=system;"
%>
<html>
<head>
<title>添加公司信息</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style>
td {
	font-size: 13px;
}
</style>
</head>

<body>
<div align="left"><!-- #include file="pagetop.asp" --></div>
<%
  dim pw,pw2,companyname,idcard,province,city,address,zipcode,fax,telphone,linkman,lmmobilephone,lmemail,remark,rs,date1,sql

  set rs=server.createobject("adodb.recordset")
  function IsValidEmail(user_mail)

dim names, name, i, c

'Check for valid syntax in an email address.

IsValidEmail = true
names = Split(user_mail, "@")
if UBound(names) <> 1 then
   IsValidEmail = false
   exit function
end if
for each name in names
   if Len(name) <= 0 then
     IsValidEmail = false
     exit function
   end if
   for i = 1 to Len(name)
     c = Lcase(Mid(name, i, 1))
     if InStr("abcdefghijklmnopqrstuvwxyz_-.", c) <= 0 and not IsNumeric(c) then
       IsValidEmail = false
       exit function
     end if
   next
   if Left(name, 1) = "." or Right(name, 1) = "." then
      IsValidEmail = false
      exit function
   end if
next
if InStr(names(1), ".") <= 0 then
   IsValidEmail = false
   exit function
end if
i = Len(names(1)) - InStrRev(names(1), ".")
if i <> 2 and i <> 3 then
   IsValidEmail = false
   exit function
end if
if InStr(email, "..") > 0 then
   IsValidEmail = false
end if

end function
  if trim(request("1"))="0" then
    errmsg=errmsg+"<br>"+"<li>您必须同意注册条约"
	founderr=true
	end if
	  if trim(request("companyname"))="" then
    errmsg=errmsg+"<br>"+"<li>公司名称不能为空"
    founderr=true
  else
    companyname=lcase(trim(request("companyname")))
  end if

  if trim(request("pw"))="" or trim(request("pw2"))="" then
    errmsg=errmsg+"<br>"+"<li>输入密码或确认密码不能为空"
    founderr=true
  else
    pw=md5(lcase(trim(request("pw"))))
    pw2=md5(lcase(trim(request("pw2"))))

  if pw <> pw2 then
    errmsg=errmsg+"<br>"+"<li>输入密码与确认密码不同"
    founderr=true
  else if len(trim(request("pw")))<6 then
    errmsg=errmsg+"<br>"+"<li>您输入的密码少于6位"
    founderr=true
  end if
  end if
  end if
  
  sql="select company_name from GSCOTT.company_info_table where company_name='"&companyname&"'"
  rs.open sql,connstr
  if not rs.eof then
    errmsg=errmsg+"<br>"+"<li>公司名称已被别人注册"
    founderr=true
  end if
  rs.close
  if trim(request("province"))="" then
    errmsg=errmsg+"<br>"+"<li>所在省份不能为空"
    founderr=true
  else
    province=trim(request("province"))
  end if
    if trim(request("city"))="" then
    errmsg=errmsg+"<br>"+"<li>所在城市不能为空"
    founderr=true
  else
    city=trim(request("city"))
  end if
    if trim(request("address"))="" then
    errmsg=errmsg+"<br>"+"<li>公司地址不能为空"
    founderr=true
  else
    address=trim(request("address"))
  end if
    if trim(request("telphone"))="" then
    errmsg=errmsg+"<br>"+"<li>联系电话不能为空"
    founderr=true
  else
    telphone=trim(request("telphone"))
  end if
  if trim(request("linkman"))="" then
    errmsg=errmsg+"<br>"+"<li>联系人不能为空"
    founderr=true
  else
    linkman=trim(request("linkman"))
  end if
  idcard=trim(request("idcard"))
  zipcode=trim(request("zipcode"))
  lmmobilephone=trim(request("lmmobilephone"))
  lmemail=trim(request("lmemail"))
  fax=trim(request("fax"))
  if lmemail<>"" then
    if isvalidemail(lmemail)=false then
      errmsg=errmsg+"<br>"+"<li>你的E-mail有错误"
      founderr=true
    end if
  end if
  remark=trim(request("remark"))
%>

<div align="center">
<center>
<table border="0" width="600" cellspacing="0" cellpadding="0">
<%  
  if founderr=false then
    date1=cstr(now)
    sql="select * from GSCOTT.company_info_table"
    rs.open sql,connstr,3,3
    rs.addnew
    rs("company_name")=companyname
    rs("company_password")=pw
	rs("company_idcard")=idcard
	rs("company_province")=province
	rs("company_city")=city
	rs("company_address")=address
	rs("company_zipcode")=zipcode
	rs("company_telphone")=telphone
	rs("company_fax")=fax
	rs("company_linkman")=linkman
	rs("company_lmmobilephone")=lmmobilephone
	rs("company_lmemail")=lmemail
	rs("company_date")=date1
    rs("company_remark")=remark
    rs.update
    rs.close
	set rs=nothing
%>
<tr><td height="20"></td></tr>
<tr> 
  <td height="20" align="center" bgcolor="#E4E2FE" colspan="3"><font color="#0000FF">公司信息添加成功</font></td>
<tr> 
  <td width="33%" height="20"><div align="right">公司名称:</div></td>
  <td width="67%" height="20" colspan="2"><div align="center"><%=companyname%></div></td>
</tr>
<tr> 
  <td width="33%" height="20"><div align="right">密码:</div></td>
  <td width="67%" height="20" colspan="2"><div align="center">请牢记您的密码!!</div></td>
</tr>
<tr> 
  <td width="33%" height="20"><div align="right">执照号:</div></td>
  <td width="67%" height="20" colspan="2"><div align="center"><%=idcard%></div></td>
</tr>
<tr> 
  <td width="33%" height="20"><div align="right">所在省份:</div></td>
  <td width="67%" height="20" colspan="2"><div align="center"><%=province%></div></td>
</tr>
<tr> 
  <td width="33%" height="20"><div align="right">所在城市:</div></td>
  <td width="67%" height="20" colspan="2"><div align="center"><%=city%></div></td>
</tr>
<tr> 
  <td width="33%" height="20"><div align="right">公司地址:</div></td>
  <td width="67%" height="20" colspan="2"><div align="center"><%=address%></div></td>
</tr>
<tr> 
  <td width="33%" height="20"><div align="right">邮编:</div></td>
  <td width="67%" height="20" colspan="2"><div align="center"><%=zipcode%></div></td>
</tr>
<tr> 
  <td width="33%" height="20"><div align="right">联系电话:</div></td>
  <td width="67%" height="20" colspan="2"><div align="center"><%=telphone%></div></td>
</tr>
<tr> 
  <td width="33%" height="20"><div align="right">传真:</div></td>
  <td width="67%" height="20" colspan="2"><div align="center"><%=fax%></div></td>
</tr>
<tr> 
  <td width="33%" height="20"><div align="right">联系人:</div></td>
  <td width="67%" height="20" colspan="2"><div align="center"><%=linkman%></div></td>
</tr>
<tr> 
  <td width="33%" height="20"><div align="right">联系人手机:</div></td>
  <td width="67%" height="20" colspan="2"><div align="center"><%=lmmobilephone%></div></td>
</tr>
<tr> 
  <td width="33%" height="20"><div align="right">联系人Email:</div></td>
  <td width="67%" height="20" colspan="2"><div align="center"><%=lmemail%></div></td>
</tr>
<tr> 
  <td width="33%" height="20"><div align="right">创建时间:</div></td>
  <td width="67%" height="20" colspan="2"><div align="center"><%=date1%></div></td>
</tr>
<tr> 
  <td width="33%" height="20"><div align="right">备注:</div></td>
  <td width="67%" height="20" colspan="2"><div align="center"><%=remark%></div></td>
</tr>
<tr>
  <%session("company_name")=companyname%><meta http-equiv="refresh" content="5;url=index.asp">
  <td height="20" colspan="3" align="center">五秒钟后自动返回到主页,如果您的浏览器没有返回,请<a href="index.asp" target="_self">单击此处</a>返回首页</td>
  </tr>
<tr><td height="20"></td></tr>
<%else%>
<meta http-equiv="refresh" content="3;url=javascript:history.go(-1)">
<tr><td height="20"></td></tr>
<tr> 
  <td width="33%" height="20" align="center">公司信息有问题</td> 
</tr>
<tr> 
  <td><%=errmsg%></td>
</tr>
<tr><td>&nbsp;</td></tr>
<tr><td align="center"><font size="-1">三秒钟后自动返回到上一页,如果您的浏览器没有返回,请<a href="javascript:history.go(-1)">单击此处</a>返回</font></td></tr>
<tr><td height="20"></td></tr>

</table>
<!-- #include file="pagefooter.html" -->
</center>
</div>
</body>
</html>

⌨️ 快捷键说明

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