webJSP简单登录注册页面代码Word格式文档下载.docx

上传人:聆听****声音 文档编号:988486 上传时间:2023-04-29 格式:DOCX 页数:7 大小:38.85KB
下载 相关 举报
webJSP简单登录注册页面代码Word格式文档下载.docx_第1页
第1页 / 共7页
webJSP简单登录注册页面代码Word格式文档下载.docx_第2页
第2页 / 共7页
webJSP简单登录注册页面代码Word格式文档下载.docx_第3页
第3页 / 共7页
webJSP简单登录注册页面代码Word格式文档下载.docx_第4页
第4页 / 共7页
webJSP简单登录注册页面代码Word格式文档下载.docx_第5页
第5页 / 共7页
webJSP简单登录注册页面代码Word格式文档下载.docx_第6页
第6页 / 共7页
webJSP简单登录注册页面代码Word格式文档下载.docx_第7页
第7页 / 共7页
亲,该文档总共7页,全部预览完了,如果喜欢就下载吧!
下载资源
资源描述

webJSP简单登录注册页面代码Word格式文档下载.docx

《webJSP简单登录注册页面代码Word格式文档下载.docx》由会员分享,可在线阅读,更多相关《webJSP简单登录注册页面代码Word格式文档下载.docx(7页珍藏版)》请在冰点文库上搜索。

webJSP简单登录注册页面代码Word格式文档下载.docx

returnfalse;

}

if(document.dlForm.UserP.value=="

密码不能为空"

document.dlForm.UserP.focus();

document.dlForm.submit();

returntrue;

/script>

/head>

body>

center>

fontsize="

6"

>

欢迎进入登录界面<

/font>

formaction="

dlhou.jsp"

onsubmit="

returncheck()"

method="

post"

name="

dlForm"

p>

用户名:

inputtype="

text"

UserN"

style="

width:

148px;

"

/>

/p>

密&

nbsp;

&

码:

password"

UserP"

146px;

submit"

value="

登&

录&

height:

43px;

input type="

button"

value="

忘记密码"

onclick="

parent.location.href('

wangji.jsp'

)"

style="

43px;

返回主页"

welcome.jsp'

/FORM>

/center>

/body>

/html>

dlhou.jsp

%@pagelanguage="

java"

import="

java.sql.*"

jsp:

useBeanid="

SQLbean"

scope="

session"

class="

lian.Lian"

登录状态<

divalign="

center"

spanclass="

style1"

/span>

br>

hr>

/div>

%

StringuserN=request.getParameter("

StringuserP=request.getParameter("

//out.print(userN);

Stringsql="

select*fromyxxwhereyname='

+userN+"

'

;

SQLbean.OpenConn();

ResultSetrs=SQLbean.executeQuery(sql);

if(!

rs.next())

%>

用户名不存在!

window.location.href="

denglu.jsp"

//while(rs.next())

else



Stringp=rs.getString("

ypassword"

).trim();

if(p.equals(userP.trim()))

// response.sendRedirect("

zhu.jsp?

param="

+userN);

session.setAttribute("

yhm"

userN);

//response.sendRedirect("

zhu.jsp"

恭喜您,登录成功!

密码错误!

rs.close();

SQLbean.closeSt();

SQLbean.closeConn();

注册界面:

注册界面<

functionzcheck()

if(document.zcForm.UserN.value=="

document.zcForm.UserN.focus();

if(document.zcForm.UserP.value=="

密码不能为空"

document.zcForm.UserP.focus();

if(document.zcForm.reUserP.value=="

确认密码不能为空"

document.zcForm.reUserP.focus();

if(document.zcForm.reUserP.value!

=document.zcForm.UserP.value)

确认密码和密码不符"

returntrue;

欢迎进入注册界面<

4"

基本信息注册<

zchou.jsp"

returnzcheck()"

zcForm"

name="

155px;

fontcolor="

red"

*<

确认密码:

reUserP"

性&

别:

radio"

UserS"

value="

Mr."

checked="

checked"

男&

Ms."

女&

年&

龄:

UserA"

密码找回问题设置<

问题1:

你最尊敬的老师是?

答案1:

Q1"

style="

155px;

问题2:

你最喜欢的学科是?

答案2:

Q2"

问题3:

你最喜欢的运动是?

答案3:

Q3"

确定"

确&

定&

33px;

/form>

注册状态<

StringuserS=request.getParameter("

StringuserA=request.getParameter("

Stringq1=request.getParameter("

Stringq2=request.getParameter("

Stringq3=request.getParameter("

SQLbean.OpenConn();

Stringsqly="

ResultSetrsy=SQLbean.executeQuery(sqly);

if(rsy.next())

用户名已被注册,请更换用户名"

zhuce.jsp"

String sql="

insert into yxxvalues('

'

+userP+"

+userS+"

+userA+"

Stringsql2="

insertintoyyzvalues('

+q1+"

+q2+"

+q3+"

SQLbean.executeUpdate(sql);

SQLbean.executeUpdate(sql2);

SQLbean.closeSt();

注册成功,将跳转登录界面"

window.location.href="

//wrq经试验表明sendRedirect()还没显示

alert提示就已经跳转

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > IT计算机 > 电脑基础知识

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2