html,css。点击修改密码在黄色框内加载修改密码的页面。点击找回密码在黄色框加载找回密码的页面。

html-css017

html,css。点击修改密码在黄色框内加载修改密码的页面。点击找回密码在黄色框加载找回密码的页面。,第1张

方法1:

两个都写了,用jquey控制显示、隐藏。

<button id="btn_reset_password">修改密码</button>

<button id="btn_get_password">找回密码</button>

<div id="reset_password">

</div>

<div id="get_password">

</div>

<script>

$('#btn_reset_password').on('click',function(){

$('#reset_password').show()

$('#get_password').hide()

})

$('#btn_get_password').on('click',function(){

$('#reset_password').hide()

$('#get_password').show()

})

</script>

方法2:

写在后端,用jquery异步加载

<%

action = request("action")

if action = "zhaohui" then

username = request("username")

'response.Write(username)

'response.End()

sql = "select * from [user] where username = " &username

set rrs = server.CreateObject("adodb.recordset")

rrs.open sql ,conn ,1 ,3

if not rrs.eof then

rrs("userpass") = md5("123456")'这边是经过加密算法的

'userpass = rrs("pass") '如果是确定用找回操作,那么数据库在一个字段存放密码,而且不能经过加密算法,但是这样不安全哦

rrs.update()

response.Write("已将您的密码初始化为123456,请重新登录修改")

rrs.close

set rrs = nothing

else

response.Write("<script language='javascript'>alert('查找不到该用户,请重新核对')history.go(-1)</script>")

response.End()

end if

end if

%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/htmlcharset=gb2312" />

<title>无标题文档</title>

<style type="text/css">

*{

margin:0

padding:0

}

body{

padding:50px

}

a{

text-decoration:none

color:#333

}

.bluepass{

background:#FFC

}

.bgpass{ background:#fff}

</style>

</head>

<body>

密码找回:

<form action="?action=zhaohui" method="post" name="form1" >

<table>

<tr>

<td colspan=2 height="30">请输入您的用户名,以便我们替你重置密码,登录您中心自己在重新设置密码</td>

</tr>

<tr>

<td width="100" height="30">用户名:</td>

<td><input id="username" class="bgpass" onfocus="javascript:this.className='bluepass'" onblur="javascript:this.className='bgpass'" type="text" name="username"></td>

</tr>

<tr>

<td height="30" colspan="2">

<input type="submit" value="提交" >

<input type="reset" value="重置" >

</td>

</tr>

</table>

</form>

</body>

</html>

我这边实现的是密码的重置,就是用你输入的用户名去关联数据库,查找到了,给密码字段userpass重置为123456,为什么这么做是,因为这个字段是通过另外一个文件md5.asp加密形成的,解密的我没涉及过,所以使用这个

当然还有一种就是你给user页面另外设立一个pass的字段,直接存储我们注册时的密码字符串,不经过加密,这样我们就可以用于找回了,但是感觉这样不安全。。所以还是不建议用这个了...

这些代码已经经过测试的了,,你把文件复制你本地站点测试看看,就好了,当然对应的字段数据表都要修改过来才是

CSS中设置文字右对齐可以通过代码:<p align="对齐方式">文本段落</p>来实现,操作步骤如下:

1.新建一个html文档,如下图红框所示;

2.可以给文档改个名字,如下图红框所示;

3.然后在<body>和</body>之间输入文字内容,如下图红框所示;

4.进一步设置以下文字的对齐方式,示例代码如下:<p align="center">孔雀为什么要东南飞?</p>;

5.在浏览器中预览,文字就实现了右对齐,如下图红框所示;