这是相对路径,你要保证你这个页面的存放盘符下有这个文件
比如你的页面放在C盘的,你要保证c:/209flashbg.rar这个文件存在,即可
这是我曾经写过的一个登录页面的详细代码,供你参考,asp的代码,不知道你看得懂不?文件名是:deafaule.asp
<% @ Language=VBScript %>
<!--#include file="inc/jf.asp"-->
<html>
<head>
<title>欢迎使用
<%
Response.Write (JFrs("Company_Name") &" —— " &JFrs("Software_Name"))
Response.Cookies("Visiter")("Identification") = "ChunLeiSky" '设置cookies的标识,在后面检测浏览器是否支持cookies
Response.Cookies("Visiter").Expires = dateadd("n",10,now()) '设置cookies的有效期为10分钟
Dim an
Randomize
an= int((99999-11111+1) * RND +11111)
session("FrontPage_Yzm")=an
%>
</title>
<meta http-equiv="Content-Type" content="text/htmlcharset=gb2312" />
<meta http-equiv="Content-Language" content="zh-cn" />
<link rel="stylesheet" type="text/css" href="main.css">
<script language=VBScript src=load.js></script>
<script language="JavaScript">
function FrontPage_valid() {
if (document.FrontPage_Form.loginName.value == "") {
alert("请先输入 [用户名] !\n如果没有帐号请先 注册!")
document.FrontPage_Form.loginName.focus()
return false
}
else if (document.FrontPage_Form.loginName.value.length <2) {
alert("在 [用户名] 中,请至少输入 2 个字符!")
document.FrontPage_Form.loginName.focus()
return false
}
else if (document.FrontPage_Form.loginPassword.value == "") {
document.FrontPage_Form.loginPassword.focus()
return false
}
else if (document.FrontPage_Form.loginPassword.value.length <5) {
alert("在 [密码] 中,请至少输入 5 个字符!")
document.FrontPage_Form.loginPassword.focus()
return false
}
else if (document.FrontPage_Form.FrontPage_Yzm.value == "") {
alert("请输入[验证码]!")
document.FrontPage_Form.FrontPage_Yzm.focus()
return false
}
else if (document.FrontPage_Form.FrontPage_Yzm.value.length != 5) {
alert("在 [验证码] 中,请输入 5 位数字!")
document.FrontPage_Form.FrontPage_Yzm.focus()
return false
}
else if (document.FrontPage_Form.FrontPage_Yzm.value.length == 5) {
var i=0,ch
for (i=0i<5i++) {
ch=document.FrontPage_Form.FrontPage_Yzm.value.charAt(i)
if (ch<"0" || ch>"9") {
alert("在 [验证码] 中,必须输入 5 位数字!")
document.FrontPage_Form.FrontPage_Yzm.focus()
return false
break
}
}
}
else {
return true
}
}
function setfocus() {
document.FrontPage_Form.loginPassword.focus()
return
}
</script>
</head>
<script language="JavaScript">
if (screen.width == 1440) {
document.write("<body background='images/bg750.jpg' onload='JavaScript:setfocus()'><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />")
}
else if (screen.width == 1280) {
document.write("<body background='images/bg660.jpg' onload='JavaScript:setfocus()'><br /><br /><br /><br /><br /><br /><br /><br />")
}
else {
document.write("<body BGcolor='#5A7EDC' onload='JavaScript:setfocus()'><br /><br /><br /><br /><br /><br /><br />")
}
</script>
<div align="center">
<form method="post" action="login.asp" name="FrontPage_Form" onSubmit="JavaScript:return FrontPage_valid()">
<table border="0" cellpadding="0" cellspacing="0" width="548" height="350" id="table11" background="images/log.jpg">
<tr height="50"><th colspan="4" class="Fir">
<% Response.Write (JFrs("Company_Name") &" —— " &JFrs("Software_Name")) %>
</th></tr>
<tr height="36"><th colspan="4" class="warning">
<%
Dim ErrCode
ErrCode = request.QueryString("ErrCode")
If ErrCode = "-1" Then
Response.Write "<li>您已成功修改账号信息,请等待管理员审核!"
ElseIf ErrCode = "0" Then
Response.Write "<li>您的帐号已成功注册,请等待管理员审核!"
End If
If ErrCode = "7" Then
Response.Write "<li>[用户名] 不能为空,且至少2个汉字,最多10个汉字"
End If
If ErrCode = "8" Then
Response.Write "<li>[密码] 不能为空,且至少5个字符,最多20个字符"
End If
If ErrCode = "9" Then
Response.Write "<li>[验证码] 错误"
End If
If ErrCode = "10" Then
Response.Write "<li>[用户名] 未注册 或 [密码] 错误"
End If
If ErrCode = "20" Then
Response.Write "<li>您的账号未通过审核,详情请咨询管理员"
End If
ErrCode = ""
%>
</th></tr>
<tr height="37"><th colspan="4" align="left"></th></tr>
<tr height="38">
<td width="202"></td>
<td width="100" align="right">用户名:</td>
<td width="224"><input type="text" name="loginName" style="width:160pxheight:20px" maxlength="10" title="请输入用户名,至少2个汉字,最多10个汉字" value="<% =request.Cookies("Visiter")("VisitName") %>" onFocus="JavaScript:this.select()" onMouseOver="JavaScript:this.focus()" onClick="Javascript:this.value=''"></td>
<td width="22"></td>
</tr>
<tr height="38">
<td width="202"></td>
<td width="100" align="right">密 码:</td>
<td width="224"><input type="password" name="loginPassword" style="width:160pxheight:20px" maxlength="20" title="请输入密码,至少5个字符"></td>
<td width="22"></td>
</tr>
<tr height="38">
<td width="202"></td>
<td width="100" align="right">验证码:</td>
<td width="224"><input name="FrontPage_Yzm" style="width:100pxheight:20px" maxlength="5" title="请输入5位的验证码">
<% Response.Write (" " &an) %>
</td>
<td width="22"></td>
</tr>
<tr height="54">
<td width="202"></td>
<th colspan="2" valign="middle">
<input type="image" src="images/login.jpg">
<a href="JavaScript:document.FrontPage_Form.reset()"><img border="0" src="images/reset.jpg"></a>
</th>
<td width="22"></td>
</tr>
<tr height="34">
<td width="202"></td>
<th colspan="2">如果您还没有帐号,请点此 <a href="reg.asp?ErrCode=0">注册</a></th>
<td width="22"></td>
</tr>
<tr height="25" class="Sec">
<td width="202" align="center"><% Response.Write (JFrs("Company") &"® 版权所有 ") %>
</td>
<th colspan="3">Copyright© 2012 All Rights Reserved</th>
</tr>
</table>
</form>
</div>
<script language="JavaScript">
if (screen.width == 1440) {
document.write("<br /><br /><br /><br /><br /><br /><br /><br /><br />")
}
else if (screen.width == 1280){
document.write("<br /><br /><br /><br />")
}
else {
document.write("<br /><br /><br /><br /><br />")
}
</script>
<center>建议使用 IE8.0或更高版本的浏览器,推荐分辨率1440×900 或更高<br />
<%
Response.Write (JFrs("Company") &"® " &JFrs("Software_Name") &" V1.0")
JFrs.Close
set JFrs = Nothing
CloseDataBase
%>
</center>
</body>
</html>
<!DOCTYPE html><html lang="zh-CN"><head><meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>登录</title>
<link href="css/bootstrap.min.css" rel="stylesheet"></head><body><nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="./">jsp作业</a>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav navbar-right">
<li><a href="login.html">登录</a></li>
</ul>
</div>
</div></nav><div class="container">
<div class="row">
<div class="col-md-4">
</div>
<div class="col-md-4">
<form class="form-signin" target="submitFrame" method="post">
<h2 class="form-signin-heading">登录到jsp作业</h2>
<label for="inputEmail">Email</label>
<input type="email" id="inputEmail" class="form-control" placeholder="请输入Email" required autofocus><br>
<label for="inputPassword">密码</label>
<input type="password" id="inputPassword" class="form-control" placeholder="请输入密码" required>
<div class="checkbox">
<label>
<input type="checkbox" value="remember-me" checked="checked">记住密码</label>
</div>
<button type="submit" class="btn btn-primary" id="btn-login">登录</button>
<a href="reg.html" class="btn btn-default">注册</a>
</form>
<iframe style="display: none" name="submitFrame" src="about:blank"></iframe>
</div>
<div class="col-md-4">
</div>
</div>
<script src="js/jquery.min.js"></script></body></html>
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)