?? forgotusername.asp
字號:
<%'=========================================
'ScriptMate User Manager Version 2.1
'Copyright 2001 (C) ScriptMate.Com
'User Module
'This module sends the forgotten username of a member to his email
'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.forgotusername
if (!ValidLength(d.members_email.value,1))error(d.members_email,"Email Should not be blank");
if (!ValidEmail(d.members_email.value))error(d.members_email,"Please enter a valid email address ex. test@example.com");
return !errfound;
}
</script>
<%Sub Forgotusername()
dim todo,action,members_email,records,memid,fname,mememail,messagebody,subject,result
if not Application("smumdebugmode") then on error resume next
action = request("action")
todo = request("todo")
if todo = "" then
smumFormAction "<form action="""&smumpage&"?action=forgotusername"" method=post name=forgotusername language=""JAVASCRIPT"" onsubmit=""return Validate();"">"
smumFormHiddenField "todo","forgotusername"
smumFormOpenTable
smumFormHeader "Forgot Username"
smumFormResponseCol "Please enter your Email Id. and we will send your Username to your Email Id."
smumFormFields "Email","<input class=fieldbox type=text size=35 maxlength=50 name=members_email>"
smumFormButtons "<input class=fieldbox type=submit value=""Submit"" id=submit2 name=submit2>"
smumFormCloseTable
smumFormClose
elseif todo = "forgotusername" then
members_email = smFixer(request("members_email"))
smumquery = "select * from smum_memberstbl where members_email = '"& members_email &"'"
smumOpenrs smumquery,"smumrs",action
if smumrs.eof then
records = false
else
records = true
memid = smumrs("members_id")
fname = smumrs("members_firstname")
mememail = smumrs("members_email")
end if
smumClosers(smumrs)
if not records then
smJSalert("Invalid Email. Please try again or if you are a New User Please Register now !")
else
messagebody = convertmes(Application("smummesforgotusernamemailcontent"), memid )
subject = Application("smumforgotusernamemailsubject")
result = sendmail(Application("smumadminemail"), mememail, Application("smumadminname"), fname, Application("smummailserver"), subject, messagebody, Application("smummailcomponent"))
if result = "sent" then
smumFormOpenTable
smumFormHeader "Forgot Username"
smumFormResponse Application("smummesforgotusernamesuccess")
smumFormCloseTable
else
smumFormOpenTable
smumFormHeader "Forgot Username"
smumFormResponse Application("smummesforgotusernameerror")
smumFormCloseTable
end if
end if
end if
End Sub%>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -