网页制作如何添加用户登录(用户名登录密码那种)
3个回答
展开全部
使用JavaScript实现。
<SCRIPT LANGUAGE="JavaScript">
function Login(form) {
var username = lue;
var password = lue;
var server = lue;
if (username && password && server) {
var htsite = "http://" + username + ":" + password + "@" + server;
window.location = htsite;
}
else {
alert("请输入用户和密码.");
}
}
</script>
把以上内容加到head部分;
然后下面的内容放在body里就好了:
<form name=login>
<input type="hidden" name="server" value=" ">
用户名:
<input type=text name=username size=20>
密 码:
<input type=password name=password size=20>
<input type=button value="登录" onClick="Login( rm)" name="button">
</form>
<SCRIPT LANGUAGE="JavaScript">
function Login(form) {
var username = lue;
var password = lue;
var server = lue;
if (username && password && server) {
var htsite = "http://" + username + ":" + password + "@" + server;
window.location = htsite;
}
else {
alert("请输入用户和密码.");
}
}
</script>
把以上内容加到head部分;
然后下面的内容放在body里就好了:
<form name=login>
<input type="hidden" name="server" value=" ">
用户名:
<input type=text name=username size=20>
密 码:
<input type=password name=password size=20>
<input type=button value="登录" onClick="Login( rm)" name="button">
</form>
展开全部
需要高级语言代码+网页设计技术,两者结合即可
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
样式
html {
background-color: #E9EEF0
}
.wrapper {
margin: 140px auto;
width: 884px;
}
.loginBox {
background-color: #FEFEFE;
border: 1px solid #BfD6E1;
border-radius: 5px;
color: #444;
font: 14px 'Microsoft YaHei','微软雅黑';
margin: 0 auto;
width: 388px
}
.loginBox .loginBoxCenter {
border-bottom: 1px solid #DDE0E8;
padding: 24px;
}
.loginBox .loginBoxCenter p {
margin-bottom: 10px
}
.loginBox .loginBoxButtons {
background-color: #F0F4F6;
border-top: 1px solid #FFF;
border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px;
line-height: 28px;
overflow: hidden;
padding: 20px 24px;
vertical-align: center;
}
.loginBox .loginInput {
border: 1px solid #D2D9dC;
border-radius: 2px;
color: #444;
font: 12px 'Microsoft YaHei','微软雅黑';
padding: 8px 14px;
margin-bottom: 8px;
width: 310px;
}
.loginBox .loginInput:FOCUS {
border: 1px solid #B7D4EA;
box-shadow: 0 0 8px #B7D4EA;
}
.loginBox .loginBtn {
background-image: -moz-linear-gradient(to bottom, #B5DEF2, #85CFEE);
border: 1px solid #98CCE7;
border-radius: 20px;
box-shadow:inset rgba(255,255,255,0.6) 0 1px 1px, rgba(0,0,0,0.1) 0 1px 1px;
color: #FFF;
cursor: pointer;
float: right;
font: bold 13px Arial;
padding: 5px 14px;
}
.loginBox .loginBtn:HOVER {
background-image: -moz-linear-gradient(to top, #B5DEF2, #85CFEE);
}
.loginBox a.forgetLink {
color: #ABABAB;
cursor: pointer;
float: right;
font: 11px/20px Arial;
text-decoration: none;
vertical-align: middle;
}
.loginBox a.forgetLink:HOVER {
text-decoration: underline;
}
.loginBox input#remember {
vertical-align: middle;
}
.loginBox label[for="remember"] {
font: 11px Arial;
}
HTML代码:
<div class="wrapper">
<form action="/chaos/EvilEmail.html" method="post" >
<div class="loginBox">
<div class="loginBoxCenter">
<p><label for="username">电子邮箱:</label></p>
<p><input type="email" id="email" name="email" class="loginInput" autofocus="autofocus" required="required" autocomplete="off" placeholder="请输入电子邮箱" value="" /></p>
<p><label for="password">密码:</label><a class="forgetLink" href="#">忘记密码?</a></p>
<p><input type="password" id="password" name="password" class="loginInput" required="required" placeholder="请输入密码" value="" /></p>
</div>
<div class="loginBoxButtons">
<input id="remember" type="checkbox" name="remember" />
<label for="remember">记住登录状态</label>
<button class="loginBtn">登录</button>
</div>
</div>
</form>
</div>
html {
background-color: #E9EEF0
}
.wrapper {
margin: 140px auto;
width: 884px;
}
.loginBox {
background-color: #FEFEFE;
border: 1px solid #BfD6E1;
border-radius: 5px;
color: #444;
font: 14px 'Microsoft YaHei','微软雅黑';
margin: 0 auto;
width: 388px
}
.loginBox .loginBoxCenter {
border-bottom: 1px solid #DDE0E8;
padding: 24px;
}
.loginBox .loginBoxCenter p {
margin-bottom: 10px
}
.loginBox .loginBoxButtons {
background-color: #F0F4F6;
border-top: 1px solid #FFF;
border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px;
line-height: 28px;
overflow: hidden;
padding: 20px 24px;
vertical-align: center;
}
.loginBox .loginInput {
border: 1px solid #D2D9dC;
border-radius: 2px;
color: #444;
font: 12px 'Microsoft YaHei','微软雅黑';
padding: 8px 14px;
margin-bottom: 8px;
width: 310px;
}
.loginBox .loginInput:FOCUS {
border: 1px solid #B7D4EA;
box-shadow: 0 0 8px #B7D4EA;
}
.loginBox .loginBtn {
background-image: -moz-linear-gradient(to bottom, #B5DEF2, #85CFEE);
border: 1px solid #98CCE7;
border-radius: 20px;
box-shadow:inset rgba(255,255,255,0.6) 0 1px 1px, rgba(0,0,0,0.1) 0 1px 1px;
color: #FFF;
cursor: pointer;
float: right;
font: bold 13px Arial;
padding: 5px 14px;
}
.loginBox .loginBtn:HOVER {
background-image: -moz-linear-gradient(to top, #B5DEF2, #85CFEE);
}
.loginBox a.forgetLink {
color: #ABABAB;
cursor: pointer;
float: right;
font: 11px/20px Arial;
text-decoration: none;
vertical-align: middle;
}
.loginBox a.forgetLink:HOVER {
text-decoration: underline;
}
.loginBox input#remember {
vertical-align: middle;
}
.loginBox label[for="remember"] {
font: 11px Arial;
}
HTML代码:
<div class="wrapper">
<form action="/chaos/EvilEmail.html" method="post" >
<div class="loginBox">
<div class="loginBoxCenter">
<p><label for="username">电子邮箱:</label></p>
<p><input type="email" id="email" name="email" class="loginInput" autofocus="autofocus" required="required" autocomplete="off" placeholder="请输入电子邮箱" value="" /></p>
<p><label for="password">密码:</label><a class="forgetLink" href="#">忘记密码?</a></p>
<p><input type="password" id="password" name="password" class="loginInput" required="required" placeholder="请输入密码" value="" /></p>
</div>
<div class="loginBoxButtons">
<input id="remember" type="checkbox" name="remember" />
<label for="remember">记住登录状态</label>
<button class="loginBtn">登录</button>
</div>
</div>
</form>
</div>
追问
能用php做吗?
追答
可以,但同样需要样式!
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询