求助自定义靓号的问题
用户自定义靓号,我想不让自定义的靓号重复,若输入的靓号重复,给出提示。(现在的代码定义的靓号能够重复)请大家帮改一下。代码如下<!--#include file="../inc/mdb.asp"-->
<!--#include file="../inc/config.asp"-->
<!--#include file="../inc/cmsprivate.asp"-->
<!--#include file="../inc/cmsfunction.asp"-->
<html>
<head>
<title>更换靓号</title>
<style>
body,td{font-size:12px;line-height:24px;}
.F14{font-size:14px;line-height:24px;}
a:link{text-decoration:none;color:#436472;}
a:visited {text-decoration:none;color:#436472;}
a:hover {text-decoration:underline;color:#FF6600;}
a:active {text-decoration:underline;color:#FF6600;}
</style>
<SCRIPT language="JavaScript" src="../js/question.js"></script>
<script type="text/javascript" language="javascript">
if (window == top)top.location.href = "user_Main.asp";
function setValue(obj){
document.getElementById("cnum").value=obj.innerHTML;
}
</script>
</head>
<body bgColor="#FFFFFF" text="#000000">
<%
dim Action
Action=LCase(request.QueryString("action"))
if UserLogined<>True then
response.write ("请登陆后操作!")
response.end
end if
'判断随机靓号
if Hx66_Points<myuidstopoints then
response.write " 您的积分不够更换随机靓号!更换随机靓号需积分"&myuidstopoints&moneyname
response.end
end if
if request.form("okok")="确认更换" then
if request.form("cnum")="" or not IsNumeric(request.form("cnum")) then
response.write"参数错误!"
Response.end
else
cnum=clng(request.form("cnum"))
end if
call SaveLog(Hx66_Name,"购买靓号:"&cnum,"-"&myuidstopoints,0)
sql="UPDATE [Hx_user] SET MyUID="&cnum&",IsBest=1 where userid="&Hx66_uid&""
conn.execute (sql)
Conn.Close
Set Conn = Nothing
response.write"<script>GetErr('更换靓号成功!', 'goto','#');</script>"
response.End
end if
'输出选定随机靓号
if request("action")="sto" then
dim coolnum,Lcoolnum
if Hx66_Points<myuidstopoints then
response.write "很抱歉,您的积分不够更换随机靓号!更换随机靓号需积分"&myuidstopoints&moneyname
response.end
end if
coolnum=MakeUIDRandom(100,24)
coolnum=split(coolnum,"|")
for i=0 to ubound(coolnum)
Lcoolnum=Lcoolnum&"<a href=""javascript:void(0);"" onclick=""setValue(this)"">"&coolnum(i)&"</a> "
next
%>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="30" class="F14"><img src="../img/system/Loginbar_icon_goods.gif"> 请点选您挑中的靓号</td><td align="right"><input type=button value="刷新列表" onClick="Javascript:location=location.href;"> </td></tr>
<tr><td colspan=2 class="F14"><%=Lcoolnum%></td></tr><FORM action="?action=add1" method="post">
<tr><td height="50" colspan=2 class="F14">当前您选中的靓号:<input type=text name="cnum" id="cnum" size=15 maxlength=8 contenteditable="false"> <input type="submit" name="okok" value="确认更换"> <input type="button" value=" 取消 " onClick="window.parent.dialogBoxClose.click();"></td></tr>
<tr><td colspan=2><img src="../img/system/Loginbar_icon_goods.gif"> 更换一次靓号需积分<%=myuidstopoints&moneyname%>进行购买;<br /><img src="../img/system/Loginbar_icon_goods.gif"> 点选您挑中的靓号后请点击确认更换;<br /><img src="../img/system/Loginbar_icon_goods.gif"> 更换靓号后原有的号将被系统收回。</form></td></tr>
</table>
<%
end if
'判断自定义靓号
if Hx66_Points<myuiddefpoints then
response.write " 您的积分不够更换自定义靓号!更换自定义靓号需积分"&myuiddefpoints&moneyname
response.end
end if
if request.form("ok")="确认更换" then
if request.form("scnum")="" or not IsNumeric(request.form("scnum")) then
response.write"参数错误!"
Response.end
else
scnum=clng(myuidone&request.form("scnum"))
end if
if Len(scnum)<>myuidnum then
response.write"请按系统设定要求输入"&myuidnum-1&"位号码!"
Response.end
end if
call SaveLog(Hx66_Name,"购买自定义靓号:"&scnum,"-"&myuiddefpoints,0)
sql="UPDATE [Hx_user] SET MyUID="&scnum&",IsBest=1 where userid="&Hx66_uid
conn.execute (sql)
Conn.Close
Set Conn = Nothing
response.write"<script>GetErr('更换自定义靓号成功!','goto','#');</script>"
response.End
end if
'输出自定义靓号
if request("action")="def" then
if Hx66_Grade<1 then
response.write "很抱歉,您所在的 <font color='red'><b>普通会员</b></font> 用户组没有权限自定义靓号!"
response.end
end if
if Hx66_Points<myuiddefpoints then
response.write "很抱歉,您的积分不够更换自定义靓号!更换自定义靓号需积分"&myuiddefpoints&moneyname
response.end
end if
%>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="30" class="F14"><img src="../img/system/Loginbar_icon_goods.gif"> 在这里,您可以自定义您喜欢的靓号</td></tr>
<FORM action="?action=add2" method="post">
<tr><td height="50" class="F14">输入您喜欢的靓号:<%=myuidone%><input type=text name="scnum" id="scnum" size=15 maxlength="<%=myuidnum-1%>"> <input type="submit" name="ok" value="确认更换"> <input type="button" value=" 取消 " onClick="window.parent.dialogBoxClose.click();"></td></tr>
<tr><td><img src="../img/system/Loginbar_icon_goods.gif"> 更换一次自定义靓号需积分<%=myuiddefpoints&moneyname%>进行购买;<br /><img src="../img/system/Loginbar_icon_goods.gif"> 自定义靓号系统默认第一位数字为<%=myuidone%>,总位数为<%=myuidnum%>。请输入其余<%=myuidnum-1%>位数字;<br /><img src="../img/system/Loginbar_icon_goods.gif"> 更换靓号后原有的号将被系统收回。</form></td></tr>
</table>
<%
end if
%>
</body>
</html>