?? block.asp
字號:
<%'=========================================
'ScriptMate User Manager Version 2.1
'Copyright 2001 (C) ScriptMate.Com
'Admin Module
'This module helps in adding and deleting the emails to the blocked email list
'For any help with modification to
'this file contact support@scriptmate.com
'=========================================%>
<script language="JAVASCRIPT">
var errfound = false;
function ValidLength(item, len) {
return (item.length >= len);
}
function ValidEmail(item) {
if (!ValidLength(item, 5)) return false;
if (item.indexOf ('@', 0) == -1) return false;
if (item.indexOf ('.', 0) == -1) return false;
return true;
}
function error(elem, text) {
if (errfound) return;
window.alert(text);
elem.select();
elem.focus();
elem.style.backgroundColor=errorcolor;
errfound = true;
}
function Validate() {
errfound = false;
d=document.block
if (!ValidEmail(d.bei_email.value))error(d.bei_email,"Please enter a valid email address ex. test@example.com");
return !errfound;
}
</script>
<%Sub Block()
dim todo,action,records,mailsar,i,id,bei_email,adderror
smumadminheader("Blocked Email Address Management")
if not Application("smumdebugmode") then on error resume next
if session("admin") = "" then Response.Redirect smumpage&"?action=login"
action = request("action")
todo = request("todo")
if todo = "" then
smumFormAction "<form action="""&smumadminpage&"?action=block"" method=post name=block language=""JAVASCRIPT"" onsubmit=""return Validate();"">"
smumFormHiddenField "todo","add"
smumFormOpenTable
smumFormHeader "Add a Email to block while a new member is registering"
smumFormFields "Email Address","<input class=fieldbox type=text maxlength=255 size=30 name=bei_email>"
smumFormButtons "<input class=fieldbox type=submit value=""Add Email"" name=submit>"
smumFormCloseTable
smumFormClose
smumquery = "select bei_id,bei_email from smum_blockedemailidstbl"
smumOpenrs smumquery,"smumrs",action
if not smumrs.eof then
records = true
mailsar = smumrs.getrows
else
records = false
end if
smumClosers(smumrs)
if records then
smumFormOpenTable%>
<tr class=colorformheader>
<td colspan=2><font class=textsize9><b>Existing Email Addresses</b></font></td>
</tr>
<tr class=colorformfields>
<td><font class=textsize9><b>Email Address</b></font></td>
<td width=5% align=center><font class=textsize9><b>Options</b></font></td>
</tr>
<%for i = 0 to ubound(mailsar,2)
Response.Write "<tr class=colorformfields>"
Response.Write "<td><font class=textsize9>"&mailsar(1,i)&"</font></td>"
Response.Write "<td width=5% align=center><font class=textsize9><a href="&smumadminpage&"?action=block&todo=delete&id="&mailsar(0,i)&"><img src=""/smusermanager/images/delete.gif"" alt=""Delete this Blocked Email Address"" border=0></a></font></td>"
Response.Write "</tr>"
next
smumFormCloseTable
end if
elseif todo = "add" then
bei_email = request("bei_email")
if bei_email = "" then
Response.Redirect smumadminpage&"?action=block"
else
smumquery = "select bei_email from smum_blockedemailidstbl where bei_email = '"&bei_email&"'"
smumOpenrs smumquery,"smumrs",action
if smumrs.eof then
else
adderror = "error occured"
smJSalert("This Email Address - "& bei_email &" has been already Blocked.")
end if
smumClosers(smumrs)
if adderror = "" then
smumquery = "insert into smum_blockedemailidstbl (bei_email) values ('"&bei_email&"')"
smumexecutequery smumquery,action
Response.Redirect smumadminpage&"?action=block"
end if
end if
elseif todo = "delete" then
id = request("id")
if id = "" then
Response.Redirect smumadminpage&"?action=block"
else
smumquery = "delete from smum_blockedemailidstbl where bei_id = " &id
smumexecutequery smumquery,action
Response.Redirect smumadminpage&"?action=block"
end if
end if
End Sub%>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -