导航:首页 > 编程语言 > 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的登陆界面代码下载相关的资料

热点内容
哪里学电脑编程好 浏览:828
linux查看每个文件的大小 浏览:69
编程模具外发在哪里接 浏览:382
收发文件登记 浏览:300
如何运用马太效应解决数据鸿沟 浏览:241
c语言文件名是文件地址吗 浏览:427
4g网络怎么定位 浏览:73
法语离线文件在哪里 浏览:968
jad版本qq 浏览:667
驱动编程需要学什么 浏览:400
微信聊天返回键wechat 浏览:7
ps的图层文件怎么放到cdr 浏览:327
微信怎么文件 浏览:911
win10讲述人进不了桌面 浏览:824
安卓xposed模块 浏览:639
卡宴u盘选择文件夹 浏览:600
删除siri程序 浏览:71
怎样把excel表格文件传到微信上 浏览:857
win10cmd不是内部或外部命令 浏览:139
奇迹私服刷装备工具 浏览:811

友情链接