样判断用户名是否重复?---我的代码有错,但不知错在哪请高手指正

qq52668 qq52668 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
<%
dim licence,company,trade,town,company_info,licence_date,deputy,workers,money,phone,fax,mail,address,note,conn
licence = dealInputString(request.Form("licence"))
company = dealInputString(request.Form("company"))
trade = dealInputString(request.Form("trade"))
town = dealInputString(request.Form("town"))
company_info = dealInputString(request.Form("company_info"))
licence_date = dealInputString(request.Form("licence_date"))
deputy = dealInputString(request.Form("deputy"))
workers = dealInputString(request.Form("workers"))
money = dealInputString(request.Form("money"))
phone = dealInputString(request.Form("phone"))
fax = dealInputString(request.Form("fax"))
mail = dealInputString(request.Form("mail"))
address = dealInputString(request.Form("address"))
note = dealInputString(request.Form("note"))

licence=trim(request("licence")) '得到用户输入的用户名

set rs=server.createobject("adodb.recordset")
sql="select licence from member where licence='"& licence &"'" '查询数据库中相同的
rs.open conn,1,1
if not (rs.eof and rs.bof) then
response.write "这个用户名已经有人使用了"
response.end
else


dim cn, sql, rs
sql = "insert into tblmqhy (licence,company,trade,town,company_info,licence_date,deputy,workers,money,phone,fax,mail,address,note) values ('" & licence & "','" & company & _
"','" &trade & "','" &town & "','" & company_info & "','" & licence_date & "','" & deputy & "','" & workers & "','" & money & "','" & phone & "','" & fax & "','" & mail & "','" & address & "','" & note & "')"

set cn = server.CreateObject("adodb.connection")
cn.Open getCnStr()
cn.Execute(sql)
cn.Close
set cn = nothing


response.write"<script language=javascript>alert('恭喜!您的申请提交成功!请等待管理员审核...');window.location.href='default.asp';</script>"
'response.Redirect("success.asp") '跳转到簿默认页
end if

%>
...全文

相关推荐

layui的表单验证支持ajax判断用户名是否重复的实例

今天小编就为大家分享一篇layui的表单验证支持ajax判断用户名是否重复的实例,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧

weixin_38686658

判断用户注册用户时用户名是否重名

private void button2_Click(object sender, EventArgs e) { if (this.textBox1.Text==""||this.textBox1.Text=="请输入用户名:") { MessageBox.Show("用户名不能为空!"); } string uname = this.textBox1.Text; string pwd = this.textBox3.Text; hyqpm.con.Close(); hyqpm.con.Open(); SqlCommand com = new SqlCommand("insert into admin values('"+uname+"','"+pwd+"')",hyqpm.con); if (checkuName(uname)) //判断用户名否存在 { MessageBox.Show( "用户名已存在!请重新输入:"); return; } if (this.textBox1.Text==""||this.textBox2.Text=="") { MessageBox.Show("密码不能为空!"); return; } if (com.ExecuteNonQuery()>0) { MessageBox.Show("提交成功!"); } hyqpm.con.Close(); } // 判断用户名是否存在 private bool checkuName(string name) { bool flag = false; SqlCommand com1 = new SqlCommand("select * from admin where loginid='" + this.textBox1.Text + "'", hyqpm.con); SqlDataReader dr1 = com1.ExecuteReader(); if (dr1.Read()) { flag = true; } dr1.Close(); return flag; }

hyqpm

javascript判断数组内是否重复的方法

主要介绍了javascript判断数组内是否重复的方法,涉及javascript针对数组的相关操作技巧,非常具有实用价值,需要的朋友可以参考下

weixin_38694541

ajax验证用户名是否重复

ajax+jQuery+struts2验证用户名是否重复

GodYT

dwr+spring实现判断用户名是否重复

dwr+spring实现判断用户名是否重复<br>一个简单的dwr例子,适合初学者

chenql1984
评论 19
收藏 已收藏
分享
返回顶部
qq52668
ASP 28,401 成员 356,940 内容