<%
'=========================================================
' 『上电在线』版权所有(C) www.semmw.com
' 您可以自由应用本程序于合法的个人或商业行为。
' 您必须保留版权信息。
'=========================================================
' Version:1.3
' Date: 2003-01-10
' Script Written by xubin
'=========================================================
' Copyright (C) 1999-2002 www.semmw.com. All rights reserved.
' Web: http://www.www.semmw.com
' Email: webmaster@www.semmw.com,webmaster@mail.www.semmw.com
'=========================================================
%>
<!--#Include File="conn.asp" -->
<!--#Include File="procedure.asp" -->
<!--#Include File="Language.asp" -->
<% 
	'Call loaderror()
	Call showwebdata()
	Call Language_var(Language,"check")
%>
<html>
<head>
<title><%=webname%> | <%=Language_check(0)%></title>
<meta http-equiv="Content-Type" content="text/html; charSet=<%=Language_charSet%>">
<link rel="stylesheet" href="images/styles.css" type="text/css">
</head>
<body leftmargin="0" Topmargin="0" marginwidth="0" marginheight="0" background="images/greystrip.gIf">
<!--#Include File="head.asp" -->

<%
Dim ranid,email

'取得随机确认码
ranid=trim(Request("ranid"))

'判断随机码是否正确,如果正确则返回TRUE
Function Isranid(ranid)
	Isranid=FALSE
	Set rs=Server.Createobject("adodb.recordset") 
	sql="select * from tempmail where ranid='"&ranid&"'"
	rs.open sql,conn,1,1
		If NOT(rs.bof AND rs.eof) Then
			Isranid=TRUE
			email=rs("email")
		End If
	rs.close
End Function

'如果随机码正确则进行
If Isranid(ranid) Then
	'正确填加新EMAIL到正式数据表
	Call addmail()
Else
	'重新输入随机码
	Call inputranid()
End If

Sub addmail()
'判断邮件是否已经成功订阅
If IsdyEmail(email) Then 
	errortext=Language_check(6)
	Call showerror1()
End If
'填加邮件到正式数据表
Set rs=Server.Createobject("adodb.recordset")
sql="select mail from mail where (id is null)"
rs.open sql,conn,1,3
rs.addnew
rs("mail")=email
rs.update
rs.close
'删除临时数据表中的邮件
Set rs=Server.Createobject("adodb.recordset")     
sql="delete from tempmail where email ='"&email&"'"     
rs.open sql,conn,1,3     
'rs.close 
'显示欢迎信息
Set rs=conn.execute("select qr from Management")%>
<center><FORM method="post" action="<%=weburl%>">
    <table border="1" cellspacing="0" cellpadding="0" width="550" bordercolor="#7C96B8" bordercolordark="#FFFFFF" bordercolorlight="#7C96B8" height="132" >
      <tr> 
<td height="20" colspan="2" bgcolor="#7C96B8" background="images/mmTo.gIf" width="546" align="center"><DIV style="FILTER: dropshadow(color=#FFFFFF, offx=1, offy=1, positive=1); WIDTH: 100%; CURSOR: hAND; POSITION: relative"><font color="#336699"><%=Language_check(1)%></font></div></td>
      </tr>
      <tr> 
<td height="84" colspan="2" width="546"><font color="#336699">&nbsp;</font><%=rs("qr")%></td>
      </tr>
      <tr> 
<td colspan="2" align="center" bgcolor="#7C96B8" height="20" background="images/mmTo.gIf" width="546"> <input name="bank" type="Submit" value="<%=Language_check(2)%>" class="Tips_bo"> 
</td>
      </tr>
    </table>
  </FORM>
</center>
<%End Sub%>

<%Sub inputranid()%>
<br><br>
<center><FORM method="post" action=check.asp>
    <table border="1" cellspacing="0" cellpadding="0" width="336" bordercolor="#7C96B8" bordercolordark="#FFFFFF" bordercolorlight="#7C96B8" height="102" >
      <tr> 
<td height="6" colspan="2" background="images/mmTo.gIf" align="center">
  <div align="center"><font color="#336699"><%=Language_check(3)%></font></div>
</td>
      </tr>
      <tr> 
<td height="65" colspan="2"> 
  <div align="center">
    <table width="93%" border="0" height="60">
      <tr> 
<td><font color="#336699"><%=Language_check(4)%></font> </td>
      </tr>
      <tr>
<td><font color="#336699"><%=Language_check(5)%></font><font color="#7C96B8"> 
  <input type="text" name="ranid" size="32"  class="bk" maxlength="100">
  </font></td>
      </tr>
    </table>
  </div>
</td>
      </tr>
      <tr> 
<td colspan="2" align="center" height="20" background="images/mmTo.gIf"> <input name="denglu" type="Submit" value="<%=Language_check(2)%>" class="Tips_bo"> 
</td>
      </tr>
    </table>
  </FORM>
</center>
<%End Sub
'关闭销毁对象
Set rs=nothing
conn.close
Set conn=nothing %>

