判断下是否有重复的JOBID,重复就再生成下次!

xuyadong 2005-05-01 03:19:51
set rs=server.createobject("adodb.recordset")
sql="select * from [ijob_person] where username='"&trim(request("username"))&"' or useremail='"&trim(request("useremail"))&"'"
rs.open sql,conn,1,3
if not rs.eof then
response.write "<br>"+"<li>对不起该用户已经存在!请返回重新输入资料!"
response.end
else
rs.addnew
rs("username")=trim(request("username"))
'---------------------------------------------------
rs("jobid")=gen_key(10)
'---------------------------------------------------
rs("password")=trim(request("password"))
rs("useremail")=trim(request("useremail"))
rs("zazhi")=request("zazhi")
rs("zcdata")=NOW()
rs("ip")=Request.serverVariables("remote_addr")
rs("name")=request("name")
rs("xingbie")=request("xingbie")
rs("minzu")=request("minzu")
rs("xueli")=request("xueli")
rs("hunyin")=request("hunyin")
rs("age")=request("age")
rs("xuexiao")=request("xuexiao")
rs("zhuanye")=request("zhuanye")
rs("x_suozaidi")=request("x_suozaidi")
rs("x_suozaidi1")=request("x_suozaidi1")
rs("huji")=request("huji")
rs("huji1")=request("huji1")
rs("shengao")=request("shengao")
rs("birthyear")=request("birthyear")
rs("birthmonth")=request("birthmonth")
rs("birthday")=request("birthday")
rs("dianhua")=request("dianhua")
if request("qq")="" then
rs("qq")=0
else
if not isnumeric(request("qq")) or len(request("qq"))>15 then
response.write "<br>"+"<li>QQ号码要求只能填写不大于15位的数字。"
response.end
else
rs("qq")=request("qq")
end if
end if
rs("gerenzhuye")=request("gerenzhuye")
rs("pingjia")=request("pingjia")
rs("jinengzhuanchang")=request("jinengzhuanchang")
rs("selectedjob1")=request("selectedjob1")
rs("selectedjob2")=request("selectedjob2")
rs("selectedjob3")=request("selectedjob3")
rs("s_PWL1")=request("s_PWL1")
rs("s_PWL2")=request("s_PWL2")
rs("s_PWL3")=request("s_PWL3")
if request("daiyuyaoqiu")="" then
rs("daiyuyaoqiu")=0
else
if not isnumeric(request("daiyuyaoqiu")) then
response.write "<br>"+"<li>待遇要求只能填写数字。"
response.end
else
rs("daiyuyaoqiu")=request("daiyuyaoqiu")
end if
end if
if person_rz=1 then
rs("administrator")=0
else
rs("administrator")=1
end if
rs("Negotiable")=request("Negotiable")
rs("provideHouseNeeded")=request("provideHouseNeeded")
rs("availOpts")=request("availOpts")
rs("availNotice")=request("availNotice")
rs("jiaoyubeijing")=request("jiaoyubeijing")
rs("dlsj")=now()
rs("xgsj")=now()
rs.update
session("reg")=now()
end if
rs.close
set rs=nothing
call closedb
session("reg")=""
response.write "<br>"+"<li><font color=""#ff0000"">注册成功,请等待管理员审核资料!</font>"
response.write "<br>"+"<li>正在进入首页...请稍等!!!!!"
response.write "<meta http-equiv=refresh content=""1;URL=../index.asp"">"
%>
...全文
168 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
xuyadong 2005-05-01
  • 打赏
  • 举报
回复
我想到了这个思想,我刚学ASP,语句都不会写!
帮我把关键语句写下吧。
www0aspsun0com 2005-05-01
  • 打赏
  • 举报
回复
循环调用,每次到数据库中搜索,有重复的就再执行gen_key()
xuyadong 2005-05-01
  • 打赏
  • 举报
回复
朋友们帮我看看
xuyadong 2005-05-01
  • 打赏
  • 举报
回复
gen_key()生成页面
<%
dim output,num
Function gen_key(digits)
dim char_array(50)
char_array(0) = "0"
char_array(1) = "1"
char_array(2) = "2"
char_array(3) = "3"
char_array(4) = "4"
char_array(5) = "5"
char_array(6) = "6"
char_array(7) = "7"
char_array(8) = "8"
char_array(9) = "9"
char_array(10) = "a"
char_array(11) = "b"
char_array(12) = "c"
char_array(13) = "d"
char_array(14) = "e"
char_array(15) = "f"
char_array(16) = "g"
char_array(17) = "h"
char_array(18) = "i"
char_array(19) = "j"
char_array(20) = "k"
char_array(21) = "l"
char_array(22) = "m"
char_array(23) = "n"
char_array(24) = "o"
char_array(25) = "p"
char_array(26) = "q"
char_array(27) = "r"
char_array(28) = "s"
char_array(29) = "t"
char_array(30) = "u"
char_array(31) = "v"
char_array(32) = "w"
char_array(33) = "x"
char_array(34) = "y"
char_array(35) = "z"
randomize
do while len(output) < digits
num = char_array(Int((35 - 0 + 1) * Rnd + 0))
output = output + num
loop
gen_key = output
End Function
%>
xuyadong 2005-05-01
  • 打赏
  • 举报
回复
up
xuyadong 2005-05-01
  • 打赏
  • 举报
回复
UP一下

28,406

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧