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

📄 default.asp

📁 中华软件联盟--留言系统1.0 演示地址:http://bbs.on-line.cn/UploadFile/2004115213938136.html 下载地址:http://bbs.on-line.
💻 ASP
字号:
<!--made by 中华软件联盟 http://www.downbest.net/-->
<!--#Include file="../Check_SI.asp"-->
<!--#include file="../dbconnect/guestbook.admin.inc.asp" -->
<%
Function checkPermission()
	If Session("admin")<>"" then 
		checkPermission=TRUE
	Else
		checkPermission=FALSE
	End if
End Function

tmp=checkPermission()
If tmp=FALSE then
%>

<%
Function checkenter()
	If username<>"" and password<>"" and otherpwd<>"" and Instr(username,"'")<1 and Instr(username," ")<1 and Instr(username,"""")<1 and Instr(username,"&")<1 then
		checkenter=TRUE
	Else
		checkenter=FALSE
	End If
End Function

Function checksysUser()
	sql="SELECT * FROM admin WHERE user='"&username&"'"
	Set rs=Server.CreateObject("adodb.recordset")
	rs.Open sql,conn,1,1
	if rs.eof then
		checksysUser=FALSE
	else
		passwd=trim(rs("pwd"))
		if passwd=password then
		   Session("admin")=username
		   checksysUser=TRUE		
	    else
		   checksysUser=FALSE
		end if
	End if
	rs.close
	conn.close
End Function
%>

<HTML>
<HEAD>
<TITLE>中华软件联盟--管理中心-用户登陆</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="../css/style.css" type="text/css">

<script language="JavaScript">
<!--
function window_onload() {
	document.mail.username.focus();
}
function cancel()
{
	mail.reset();
}

function IsValid()
{
	if (document.mail.username.value=="")
	{
		alert("用户名不能为空");
		document.mail.username.focus();
		return false;
	}
	if (document.mail.password.value=="")
	{
		alert("密码不能为空");
		document.mail.password.focus();
		return false;
	}
	if (document.mail.otherpwd.value=="")
	{
		alert("附加码不能为空");
		document.mail.otherpwd.focus();
		return false;
	}
}
//-->
</script>
</HEAD>

<BODY bgColor=#003366 topMargin=0 leftmargin="0" onload="return window_onload()">
<p>&nbsp;</p>
<%
	if Request.Form("action")="true" then
		username=trim(Request.Form("username"))
		password=trim(Request.Form("password"))
		position = Trim(Request.form("postion"))
		otherpwd = Trim(Request.form("otherpwd"))
		reotherpwd = Trim(Request.form("reotherpwd"))
		
		a=checkenter()
		If a=TRUE then
			if otherpwd = reotherpwd then
				b=checksysUser()
				if b=true then
						Response.Redirect("manage.asp")
				else
					errmsg="<font color=#FF0000><b>用户名或者用户密码错误,请重新输入!</b></font>"
				end if
			else
				errmsg="<font color=#FF0000><b>附加码输入错误,请重新输入!</b></font>"
			end if
		else
			errmsg="<font color=#FF0000><b>用户名输入有误,请重新输入!</b></font>"
		end if
	end if 
%>
<div align="center"><%=errmsg%><br></div>
<table width="450" height="289" border="0" cellpadding="0" cellspacing="0" background="images/admin.gif" align="center">
  <form name=mail action="default.asp" onSubmit="return IsValid();" method=post>
    <tr> 
      <td width="83" height="133">&nbsp;</td>
      <td width="283">&nbsp;</td>
      <td width="84">&nbsp;</td>
    </tr>
    <tr> 
      <td height="98">&nbsp;</td>
      <td valign="top"> 
        <table cellspacing=0 cellpadding=0 width=247 border=0 align="center">
          <tbody> 
          <tr> 
            <td height="28" style="line-height:180%"> 帐&nbsp;&nbsp;号:      
              <input type="text" name="username" size="20" class="button1">
            </td>
          </tr>
          <tr> 
            <td height="28" style="line-height:180%"> 密&nbsp;&nbsp;码:      
              <input type="password" name="password" size="20" class="button1">
            </td>
          </tr>
          <tr>
            <td height="28" style="line-height:180%"> 附加码:  
              <input type="text" name="otherpwd" size="20" class="button1">
              <% 
				dim temprnd
				Randomize
				temprnd=cstr(Int((9999 - 1000 + 1) * Rnd() + 1000))
				response.Write (temprnd)
			  %>
              <input type="hidden" name="action" value="true"> 
			  <input type="hidden" name="postion" value="<%=postion%>"> 
			  <input type="hidden" name="reotherpwd" value="<%=temprnd%>"> 
			  </td>
          </tr>
          </tbody> 
        </table>
      </td>
      <td>&nbsp;</td>
    </tr>
    <tr> 
      <td>&nbsp;</td>
      <td valign="top"> 
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr> 
            <td> 
              <div align="center"> <a href="/"><font color="#0000FF">返回首页</font></a> 
              </div>
            </td>
            <td> 
              <input type=image height=23 width=62 src="images/btn_index_ok.gif" border=0 name=submit1>
              <img onMouseOver="event.srcElement.style.cursor='hand'" onClick=cancel() height=23 src="images/btn_index_cancel.gif" width=62 border=0> </td>
          </tr>
        </table>
      </td>
      <td>&nbsp;</td>
    </tr>
  </form>
</table>
</BODY>
</HTML>
<%
Else
	response.redirect "manage.asp"
End if
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -