导航:首页 > 编程语言 > html的登陆界面代码下载

html的登陆界面代码下载

发布时间:2024-11-14 02:13:07

1. jsp登陆界面源代码

1、login.jsp文件

<%@ page language="java" contentType="text/html; charset=GB18030"

pageEncoding="GB18030"%>

<%@ page import="java.util.*" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

<head>

<title>登录页面</title>

</head>

<body>

<form name="loginForm" method="post" action="judgeUser.jsp">

<table>

<tr>

<td>用户名:<input type="text" name="userName" id="userName"></td>

</tr>

<tr>

<td>密码:<input type="password" name="password" id="password"></td>

</tr>

<tr>

<td><input type="submit" value="登录" style="background-color:pink"> <input

type="reset" value="重置" style="background-color:red"></td>

</tr>

</table>

</form>

</body>

</html>

2、judge.jsp文件

<%@ page language="java" contentType="text/html; charset=GB18030"

pageEncoding="GB18030"%>

<%@ page import="java.util.*" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

<head>

<title>身份验证</title>

</head>

<body>

<%

request.setCharacterEncoding("GB18030");

String name = request.getParameter("userName");

String password = request.getParameter("password");

if(name.equals("abc")&& password.equals("123")) {

3、afterLogin.jsp文件

%>

<jsp:forward page="afterLogin.jsp">

<jsp:param name="userName" value="<%=name%>"/>

</jsp:forward>

<%

}

else {

%>

<jsp:forward page="login.jsp"/>

<%

}

%>

</body>

</html>

<%@ page language="java" contentType="text/html; charset=GB18030"

pageEncoding="GB18030"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

<head>

<title>登录成功</title>

</head>

<body>

<%

request.setCharacterEncoding("GB18030");

String name = request.getParameter("userName");

out.println("欢迎你:" + name);

%>

</body>

</html>

(1)html的登陆界面代码下载扩展阅读:

java web登录界面源代码:

1、Data_uil.java文件

import java.sql.*;

public class Data_uil

{

public Connection getConnection()

{

try{

Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");

}catch(ClassNotFoundException e)

{

e.printStackTrace();

}

String user="***";

String password="***";

String url="jdbc:sqlserver://127.0.0.1:1433;DatabaseName=***";

Connection con=null;

try{

con=DriverManager.getConnection(url,user,password);

}catch(SQLException e)

{

e.printStackTrace();

}

return con;

}

public String selectPassword(String username)

{

Connection connection=getConnection();

String sql="select *from login where username=?";

PreparedStatement preparedStatement=null;

ResultSet result=null;

String password=null;

try{

preparedStatement=connection.prepareStatement(sql);

preparedStatement.setString(1,username);

result=preparedStatement.executeQuery();//可执行的 查询

if(result.next())

password=result.getString("password");

}catch(SQLException e){

e.printStackTrace();

}finally

{

close(preparedStatement);

close(result);

close(connection);

}

System.out.println("找到的数据库密码为:"+password);

return password;

}

public void close (Connection con)

{

try{

if(con!=null)

{

con.close();

}

}catch(SQLException e)

{

e.printStackTrace();

}

}

public void close (PreparedStatement preparedStatement)

{

try{

if(preparedStatement!=null)

{

preparedStatement.close();

}

}catch(SQLException e)

{

e.printStackTrace();

}

}

public void close(ResultSet resultSet)

{

try{

if(resultSet!=null)

{

resultSet.close();

}

}catch(SQLException e)

{

e.printStackTrace();

}

}

}

2、login_check.jsp:文件

<%@ page language="java" contentType="text/html; charset=utf-8"

pageEncoding="utf-8"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<title>验证用户密码</title>

</head>

<body>

<jsp:useBean id="util" class="util.Data_uil" scope="page" />

<%

String username=(String)request.getParameter("username");

String password=(String)request.getParameter("password");

if(username==null||"".equals(username))

{

out.print("<script language='javaScript'> alert('用户名不能为空');</script>");

response.setHeader("refresh", "0;url=user_login.jsp");

}

else

{

System.out.println("输入的用户名:"+username);

String passwordInDataBase=util.selectPassword(username);

System.out.println("密码:"+passwordInDataBase);

if(passwordInDataBase==null||"".equals(passwordInDataBase))

{

out.print("<script language='javaScript'> alert('用户名不存在');</script>");

response.setHeader("refresh", "0;url=user_login.jsp");

}

else if(passwordInDataBase.equals(password))

{

out.print("<script language='javaScript'> alert('登录成功');</script>");

response.setHeader("refresh", "0;url=loginSucces.jsp");

}

else

{

out.print("<script language='javaScript'> alert('密码错误');</script>");

response.setHeader("refresh", "0;url=user_login.jsp");

}

}

%>

</body>

</html>

3、loginSucces.jsp文件

<%@ page language="java" contentType="text/html; charset=utf-8"

pageEncoding="utf-8"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">

<title>Insert title here</title>

</head>

<body>

<hr size="10" width="26%" align="left" color="green">

<font size="6" color="red" >登录成功 </font>

<hr size="10" width="26%" align="left" color="green">

</body>

</html>

4、user_login.jsp文件

<%@ page language="java" contentType="text/html; charset=utf-8"

pageEncoding="utf-8"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">

<title>登录界面</title>

</head>

<body background="C:Userswin8workspaceLoginimage\_10.jpg" >

<center>

<br><br><br><br><br><br>

<h1 style="color:yellow">Login</h1>

<br>

<form name="loginForm" action="login_check.jsp" method="post">

<table Border="0" >

<tr >

<td>账号</td>

<td><input type="text" name="username"></td>

</tr>

<tr>

<td>密码</td>

<td><input type="password" name="password">

</td>

</tr>

</table>

<br>

<input type="submit" value="登录" style="color:#BC8F8F">

</form>

</center>

</body>

</html>

2. 黄老师,我做了一个简单的html 登录界面,有账号和密码输入以及提交按钮

(VB) 自动填写网页表单参考源码

VB6中采用WebBrowser自动填写并提交表单参考源码,已经可以实现自动填写并提交。对代码优化可以达到更好的效果。

Public Sub WebbFormEditing()

Dim i, j As Integer
Dim vForm, vSubmit
Dim vFrame
On Error Resume Next
Set vFrame = WebBrowser1.Document.frames
If IsEmpty(vFrame) Then GoTo ErrorFormEdit
For i = 0 To vFrame.length - 1
On Error Resume Next
vFrame(i).Document.body.innerHTML = tbHtml.Text
Next i
ErrorFormEdit:
On Error GoTo ErrorFormEditEnd
Set vForm = WebBrowser1.Document.Forms
If IsEmpty(vForm) Then GoTo ErrorFormEditEnd
Me.CurWebbState = 3 '填表单
For i = 0 To vForm.length - 1
On Error GoTo ErrorFormEditEnd
If InStr(1, vForm(i).name, "login", vbTextCompare) > 0 Then '登录

ElseIf InStr(1, vForm(i).name, "search", vbTextCompare) > 0 Or _
InStr(1, vForm(i).name, "find", vbTextCompare) > 0 Then '搜索

Else '其他表单,先填了
On Error Resume Next
vForm(i).onSubmit = ""
For j = 0 To vForm(i).length - 1
If UCase(vForm(i)(j).tagName) = "INPUT" Then 'INPUT
Select Case LCase(vForm(i)(j).Type)
'********************text*********************
Case "text":
'1,链接
If InStr(1, vForm(i)(j).name, "url", vbTextCompare) > 0 Or InStr(1, vForm(i)(j).name, "link", vbTextCompare) > 0 Or _
InStr(1, vForm(i)(j).name, "home", vbTextCompare) > 0 Or InStr(1, vForm(i)(j).name, "address", vbTextCompare) > 0 Or _
InStr(1, vForm(i)(j).name, "tags", vbTextCompare) > 0 Then
vForm(i)(j).Value = tbLink.Text
'EMail
ElseIf InStr(1, vForm(i)(j).name, "email", vbTextCompare) > 0 Then
vForm(i)(j).Value = tbEmail.Text
'名称
ElseIf InStr(1, vForm(i)(j).name, "name", vbTextCompare) > 0 Or InStr(1, vForm(i)(j).name, "user", vbTextCompare) > 0 Or _
InStr(1, vForm(i)(j).name, "author", vbTextCompare) > 0 Then
vForm(i)(j).Value = tbName.Text
'标题
ElseIf InStr(1, vForm(i)(j).name, "title", vbTextCompare) > 0 Or InStr(1, vForm(i)(j).name, "topic", vbTextCompare) > 0 Then
If Len(vForm(i)(j).Value) <= 0 Then vForm(i)(j).Value = tbTitle.Text
'评论,摘要
ElseIf InStr(1, vForm(i)(j).name, "summary", vbTextCompare) > 0 Or InStr(1, vForm(i)(j).name, "comment", vbTextCompare) > 0 Or _
InStr(1, vForm(i)(j).name, "content", vbTextCompare) > 0 Then
vForm(i)(j).Value = tbTextArea.Text
'qq
ElseIf InStr(1, vForm(i)(j).name, "qq", vbTextCompare) > 0 Or InStr(1, vForm(i)(j).name, "icq", vbTextCompare) > 0 Then
vForm(i)(j).Value = tbQQ.Text
'验证码
ElseIf InStr(1, vForm(i)(j).name, "Random", vbTextCompare) > 0 Then
Beep

End If
'****************text***************
Case "password"

Case "submit"
Set vSubmit = vForm(i)(j)

End Select
ElseIf UCase(vForm(i)(j).tagName) = "SELECT" Then

ElseIf UCase(vForm(i)(j).tagName) = "TEXTAREA" Then
vForm(i)(j).innerHTML = tbTextArea.Text
End If

Next j
' 当前表单填完,提交
If Not IsEmpty(vSubmit) Then
On Error GoTo ErrorFormEditEnd
Me.LbState.Caption = "提交"
Me.CurWebbState = 4
vSubmit.Click
End If
End If

Next i

If Me.CurWebbState <> 4 Then Me.CurWebbState = 5 '没有可提交的表单
Exit Sub '结束过程

'出错退出
ErrorFormEditEnd:
Me.CurWebbState = 11
End Sub

3. html网页设计:一个简单的登录界面代码!

大致形式应该是这样的:
<!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>
<title>3</title>
</head>
<body>
<div align="center">
<form action="" name="myform">
<table>
<tr>
<td>用户名:</td>
<td><input type="text" id="user" /></td>
</tr>
<tr>
<td>密 码:</td>
<td><input type="text" id="password" /></td>
</tr>
<tr>
<td>验证码:</td>
<td align="left"><input type="text" size="5" id="code" /></td>
</tr>
</table>
</form>
<table>
<tr>
<td>
<input type="submit" value="提交" onclick=myfun_submit() />
</td>
<td>
<input type="submit" value="重置" onclick=myfun_reset() />
</td>
</tr>
</table>
</div>
<script type="text/javascript">
function myfun_submit(){

var user_val = document.getElementById("user").value;
var password_val = document.getElementById("password").value;
if(user_val==""){

alert("用户名不能为空!!");

}else if(password_val==""){

alert("密码不能为空!!!");

}

}
function myfun_reset(){
document.getElementById("user").value = "";
document.getElementById("password").value = "";
document.getElementById("code").value = "";

}
</script>
</body>
</html>

4. 用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>

5. html登录界面设置账号密码

写js啊,
<script>
var username = document.getElementsClassName('bt_input')[0];
var password = document.getElementsClassName('bt_input')[1];
var button= document.getElementsClassName('logingBut')[0];
button.onclick=function(){
if(username .value=="user"&&password .value=="123456"){
location.href="下一个网页的网址";
}else{
alert("账号或密码错误!");
window.opener = null;
window.open("", "_self");
window.close();

}
}
</script>
把这段代码放在</body>前面就好了,,纯手打,采纳哈

阅读全文

与html的登陆界面代码下载相关的资料

热点内容
js组合快捷键 浏览:174
linux系统盘默认挂在的文件夹 浏览:667
淘宝数据包如何操作上架 浏览:567
vb编程中输入cls是什么意思 浏览:81
linuxtime服务 浏览:184
疯狂安卓讲义第二版代码 浏览:420
老炮儿三小时版本下载 浏览:313
matlab怎么调试程序 浏览:2
winxp升级win7的危害 浏览:496
网络没连上却不可用是怎么回事 浏览:752
社区版本 浏览:738
怎么查微信公众号什么时候开通的 浏览:717
安装三菱编程闪退怎么回事 浏览:488
手机怎么创建word文件格式 浏览:694
c语言连接数据库 浏览:887
数据线粉色和白色哪个是正 浏览:775
vb编程应注意什么 浏览:855
js循环添加控件 浏览:615
学习计算机网络的作用 浏览:235
access数据库最新内容怎么调 浏览:203

友情链接