html登陸頁面
如果不聯網就用js設置賬號密碼,錯誤時候顯示賬號或密碼錯誤,沒有的時候顯示賬號密碼不能為空,只有正確才可以執行頁面跳轉
2. HTML實現簡單的登陸
最簡單的方法也得是在後台連接資料庫進行用戶信息的判斷,這是登錄和注冊的基本流程!設計出登錄和注冊的頁面,做好你的前台驗證工作,如非空,格式等驗證;然後添加按鈕方法,在後台進行資料庫連接,然後判斷用戶的用戶名是否存在,如果存在再判斷密碼是否正確!
3. 登錄頁面html代碼
<htmlxmlns="http://www.w3.org/1999/xhtml"><head>
<metahttp-equiv="Content-Type"content="text/html;charset=utf-8">
<title>貴美商城</title>
<linkrel="stylesheet"type="text/css"href="css/global.css">
<linkrel="stylesheet"type="text/css"href="css/layout.css">
<scripttype="text/javascript">
//snameCheck()&&passCheck()
functionvalidateform(){
if(snameCheck()&&passCheck())
returntrue;
else
returnfalse;
}
//ScreenNameValidation
functionsnameCheck(){
varsname=document.getElementsByName("sname")[0].value;
varillegalChars=/W/;
if(sname.length!=0){
if(illegalChars.test(sname)){
document.getElementById("passMsg").innerHTML.replace(/'會員名無效'/,'');
document.getElementById("passMsg").innerHTML='會員名無效';
document.getElementsByName("sname")[0].select();
returnfalse;
}
}
else
{
document.getElementById("userMsg").innerHTML.replace(/'是否忘記輸入會員名?'/,'');
document.getElementById("userMsg").innerHTML='是否忘記輸入會員名?';
document.getElementsByName("sname")[0].focus();
returnfalse
}
if(sname!=="zhangsan"){//驗證會員名必須為張三
document.getElementById("userMsg").innerHTML.replace(/'是否輸入的會員名有錯?'/,'');
document.getElementById("userMsg").innerHTML='是否輸入的會員名有錯?';
document.getElementsByName("sname")[0].focus();
returnfalse;
}
returntrue;
}
functionpassCheck(){
varuserpass=document.getElementsByName("pass")[0].value;
varillegalChars=/[W_]/;//allowonlycharactorsandnumbers
//CheckifPasswordfieldisblank.
if(userpass==""){
document.getElementById("passMsg").innerHTML.replace(/'未輸入密碼 "+"請輸入密碼'/,'');
document.getElementById("passMsg").innerHTML='未輸入密碼 "+"請輸入密碼';
document.getElementsByName("pass")[0].focus();
returnfalse;
}
//.
if(userpass.length<6){
document.getElementById("passMsg").innerHTML.replace(/'密碼必須多於或等於6個字元。 '/,'');
document.getElementById("passMsg").innerHTML='密碼必須多於或等於6個字元。 ';
document.getElementsByName("pass")[0].focus();
returnfalse;
}
//.
elseif(illegalChars.test(userpass)){
document.getElementById("passMsg").innerHTML.replace(/'密碼包含非法字元'/,'');
document.getElementById("passMsg").innerHTML='密碼包含非法字元';
document.getElementsByName("pass")[0].select();
returnfalse;
}
if(userpass!=="123456"){//驗證密碼必須為123456
document.getElementById("passMsg").innerHTML.replace(/'密碼錯誤,請重新輸入!'/,'');
document.getElementById("passMsg").innerHTML='密碼錯誤,請重新輸入!';
document.getElementsByName("pass")[0].focus();
returnfalse;
}
returntrue;
}
</script>
<scripttype="text/javascript"charset="utf-8"src="http://cdn.gwdang.com/js/gwdang-notifier-bdext.js"></script></head>
<body>
<divid="container">
<iframeid="header"src="header.htm"width="980"height="136"frameborder="0"scrolling="no"></iframe>
<formaction="login_success"method="post">
<divclass="login">
<ulclass="formf_l">
<h1><imgsrc="images/logintitle.gif"alt="會員登錄"></h1>
<liclass="login_list"><label>會員名:</label><inputtype="text"name="login">(可包含a-z、0-9和下劃線)</li>
<liclass="login_list"><label>密 碼:</label><inputtype="text"name="pwd">(至少包含6個字元)</li>
<liclass="a_c"><imgsrc="images/login.gif"alt="登錄"></li>
<liclass="desc">δ <ahref="#">什麼是安全登錄</a>。</li>
<liclass="desc">δ 香港會員(繁體中文用戶)由此<ahref="#">登入</a></li>
<liclass="desc">δ <ahref="#">密碼安全貼士</a>。</li>
<liclass="desc">δ 防止病毒或者木馬竊取您的賬戶信息,<ahref="#">在線檢查</a>您的電腦是否安全。</li>
</ul>
<h1><imgsrc="images/register.gif"alt="注冊會員"></h1>
<ulclass="asidef_l">
<liclass="regpic"><span>便宜有好貨!</span>超過7000萬件商品任您選。</li>
<liclass="regpicregpic2"><span>買賣更安全!</span>交易超安全。</li>
<liclass="regpicregpic3"><span>免費開網店!</span>輕松賺錢交友。</li>
<liclass="regpicregpic4"><span>超人氣社區!</span>彩活動每一天</li>
<liclass="a_c"><ahref="#"><imgsrc="images/registernow.gif"alt="現在就注冊"></a></li>
<ulclass="reged">
<liclass="regpicregpic5">您已經是會員?<ahref="#">由此登入</a></li>
<liclass="regpicregpic6">繁體中文用戶由此<ahref="#">注冊</a></li>
</ul>
</ul>
</div>
</form>
<iframeid="footer"src="footer.htm"width="980"height="136"frameborder="0"scrolling="no"></iframe>
</div><!--containerend--> <divclass="_bd_ext_tip"style="visibility:hidden;"><spanclass="_bd_ext_search">網路一下</span><spanclass="_bd_ext_open">打開鏈接</span><spanclass="_bd_ext_">復制</span></div></body></html>
4. 求一段用戶登錄html代碼
<html>
<head>
<title>登陸頁面</title>
</head>
<form action="login_conf.jsp" method="post">
用戶登陸
用戶名:<input type="text" name="uname">
密碼: <input type="password" name="upassword">
<input type="submit" value="提交">
<input type="reset" value="重置">
</form>
</body>
</html>
****************************************************
驗證頁面jsp代碼如下:
<html>
<head>
<title>用戶驗證頁面</title>
</head>
<h1> 登陸範例專-登陸成功 </h1>
</html>
不知道你用啥屬樣的前台 是jsp還是asp.net或者是php
5. 用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>
6. 如何用HTML製作登陸界面(包括實現登陸、驗證)
靜態頁面就用html布局表單就行啊,至於後台交互驗證就需要PHP或者js。
希望我的回答對您有用。如果有用記得點贊哦!有問題可以再問我哦!
7. javascript html 設計一個登錄界面
注冊頁面代碼:
<!DOCTYPEhtml>
<htmllang="en">
<head>
<metacharset="UTF-8">
<title>注冊</title>
</head>
<body>
<formmethod="post"onsubmit="returnfalse"id="form">
<inputtype="text"name="username"placeholder="用戶名"><br>
<inputtype="password"name="password"placeholder="密碼"><br>
<inputtype="password"name="rePassword"placeholder="再次輸入密碼"><br>
<inputtype="submit"onclick="register_user()"value="注冊"><br>
</form>
<ahref="login.html">去登錄</a><script>
varlocalDB=openDatabase('localDB','1.0','TestDB',2*1024*1024);
localDB.transaction(function(ts){
ts.executeSql('CREATETABLEIFNOTEXISTSuser(username,password)')
});
functionregister_user(){
varusername=document.getElementsByTagName("input")[0].value;
varpassword=document.getElementsByTagName("input")[1].value;
varrePassword=document.getElementsByTagName("input")[2].value;
if(password!=rePassword)
{
alert("兩次輸入的密碼不同,請重新輸入");
}else
{
localDB.transaction(function(ts){
ts.executeSql("INSERTINTOuser(username,password)VALUES('"+username+"','"+password+"');");
alert("注冊成功");
});
}
}
</script>
</body>
</html>
登錄頁面代碼:
<!DOCTYPEhtml>
<htmllang="en">
<head>
<metacharset="UTF-8">
<title>登錄</title>
</head>
<body>
<formonsubmit="returnfalse"method="post">
<inputtype="text"placeholder="用戶名"><br>
<inputtype="password"placeholder="密碼"><br>
<inputtype="submit"value="登錄"onclick="login()"><br>
</form>
<ahref="register.html">去注冊</a>
<script>
varlocalDB=openDatabase('localDB','1.0','TestDB',2*1024*1024);
localDB.transaction(function(ts){
ts.executeSql("SELECT*FROMuser",[],function(tx,results){
varlen=results.rows.length;
if(len<=0)
{
localDB.transaction(function(ts){
ts.executeSql('CREATETABLEIFNOTEXISTSuser(username,password)')
});
}
});
});
functionlogin(){
varusername=document.getElementsByTagName("input")[0].value;
varpassword=document.getElementsByTagName("input")[1].value;
localDB.transaction(function(ts){
ts.executeSql("SELECT*FROMuserWHEREusername='"+username+"';",[],function(ts,res){
if(res.rows.length<=0)
{
alert("登錄失敗,用戶未注冊");
}elseif(password==res.rows[0].password)
{
alert("登錄成功,三秒後跳轉到網路");
setInterval(function(){
location.href="https://www..com";
},3000);
}else
{
alert("登錄失敗,密碼錯誤");
}
});
})
}
</script>
</body>
</html>
以上代碼使用了WEB SQL,還請選擇合適的瀏覽器查看。
8. html登陸界面代碼
實現這個功能要兩個網頁,一個是前台靜態網頁,用兩個文本框分別為t1,t2,一回個按鈕active後面寫上你要跳答轉的後台網頁的名稱如"houtai.asp"
以下是houtai.asp的代碼
<%
dim
a,b
a=request.from("t1")
b=request.from("t2")
if
a<>admin
then
response.write
"用戶名錯誤"
else
if
b<> 123456
then
response.write
"密碼錯誤"
else
response.redirect
"你要轉到的主頁.asp"
end
if
end
if
%>
9. html登錄頁面設計
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<link href="main.css" type="text/css" rel="stylesheet">
<title>登陸界面</title>
</head>
<body>
<div class="login_ico">
<img src="images/login_ico.png">
</div>
<div class="login_putin">
<ul>
<li><input type="text" ></li>
<li><input type="password" ></li>
</ul>
</div>
<div class="login_btn">
<input type="submit" value="登陸">
</div>
</body>
</html>
樣式 :
*{
margin:0;
padding:0;}
li{
list-style-type:none;
margin:0;
padding:0;}
a{
text-decoration:none;
color:#000;}
/*---------------------按鈕-----------------------------*/
.login_putin ul li input{
margin: 0;
width:70%;
padding: 1em 2em 1em 5.4em;
-webkit-border-radius:.3em;
-moz-border-radius: .3em;
border: 1px solid #999;
}
.login_btn{
width:300px;
margin:40px auto 0 auto;
}
.login_btn input{
width:100%;
margin:0;
padding:.5em 0;
-webkit-border-radius:.3em;
-moz-border-radius: .3em;
border:#1263be solid 1px;
background:#1b85fd;
color:#FFF;
font-size:17px;
font-weight:bolder;
letter-spacing:1em;
}
.login_btn input:hover{
background:#1263be;
}