⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 forgotusername.asp

📁 一个虚拟主机代理系统
💻 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 + -