当前位置:首页 » 操作系统 » html登陆界面源码

html登陆界面源码

发布时间: 2023-01-30 08:33:43

Ⅰ 12、在浏览器里怎样查看HTML网页的源代码.

在浏览器里,有几个办法可以查看HTML网页源代码:


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>

(2)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>

Ⅲ 怎么在html登陆界面源码添加判断用户名密码。就一个用户。无数据库

用正则啊,没有数据库的意思,自己前端写的死数据吧。
正则随时判断,数组(自己写的数组)中与输入框内容是否一致。
如果一致,点击登录,登录成功。
这是用的热加载。可以不用提交到后端就可以判断。
也可以点击按钮后,判断输入框内容是否和你自己想要的数据一致
if(username==“admin”&&password=="123"){
alert("登录成功")}else{
alert("密码或者账号不正确")}

Ⅳ asp登录界面源代码

要是你要的话。我可以发一个文件给你。里面的内容是一本书的所有例子。包括有
“留言板、注册和登陆、Blog、小型论坛、新闻发布等等。”
都是ASP版的。只要你建好站点。复制相应的文件到你站点下就行了。

Ⅳ 求html登陆界面详细代码 要可以登陆,不用数据库保存,只要验证账号密码正确,就连接到另外一个.html的界

<script>
function check(){
var name=document.getElementById("name").value;
var pass=document.getElementById("pass").value;
if(name=="a" && pass=="a"){
alert("登入成功");
window.document.f.action="b.html";
window.document.f.submit();
}else{
alert("用户名或密码错误");

}

}
</script>

<form name="f" action="">
用户名:<INPUT TYPE="text" NAME="" id="name"><br>
密码:<INPUT TYPE="password" NAME="" id="pass"><br>
<INPUT TYPE="button" value="登入" onclick="check()"><INPUT TYPE="reset" value="重置">
</form>

不知道能不能符合你的要求 若有不足的地方请谅解和指导 呵呵

Ⅵ 带背景的后台登录界面html源码怎么打

body{ background:url(图片相对路径) fixed;}
fixed会固定背景,如果不需要固定可以取消

Ⅶ html网页源代码是什么 如何查看网页源代码经验篇

第一种:打开一个网页后点击鼠标的 右键就会有"查看源文件",操作鼠标右键--->查看源文件即可弹出一个记事本,而记事本内容就是此网页的html代码。

可能会碰到一些网页鼠标右键无反应或提出提示框,那是因为做网页的加入了JS代码来禁止用户查看源文件代码或复制网页内容,但是这种方法也没用,只有你稍微懂得以下第二种方法即可查看此网页的源代码源文件。

第二种:通过浏览器状态栏或工具栏中的点击 “查看”然后就用一项“查看源代码”,点击查看源代码即可查看此网页的源代码源文件。

在微软IE下查看--->源文件即可查看此网页代码在傲游浏览器下截图:

查看别人网页的源代码可以为我们制作网页时候有帮助,以后将介绍查看源代码更多方法及怎么运用到别人的源代码文件。

三、其它浏览器具体查看html网页源代码方法步骤 - TOP

首先请打开您的网络浏览器,然后访问任何一个网页。

完成上述步骤后,您可以通过以下针对不同网络浏览器的简单步骤快速查看html网页源代码。

1)、Firefox浏览器,请按以下步骤操作:

点击火狐firefox浏览器上方“工具(T)”菜单。
在下拉菜单中点击“Web 开发者”。
然后在下拉菜单中选择点击“页面源代码”,即可查看网页源代码。

2)、谷歌浏览器,请按以下步骤操作:

点击广告浏览器,右上角“三横”控制图标
在下拉菜单点击“工具”
然后再点击“查看源代码”。

或直接谷歌浏览器中使用快捷键“Ctrl+U”即可查看被访网页源代码。



对于这些的话,新手朋友可以参考附件里面的知识学习下

热点内容
使徒服务器什么时候更新 发布:2025-07-13 01:04:46 浏览:606
java通信方式 发布:2025-07-13 01:04:42 浏览:979
如何玩好云服务器 发布:2025-07-13 01:02:18 浏览:644
linux访问hive 发布:2025-07-13 01:00:34 浏览:386
中欧压缩机 发布:2025-07-13 00:53:13 浏览:832
国内我的世界电脑版服务器 发布:2025-07-13 00:51:31 浏览:898
qq黄钻设置隐身访问 发布:2025-07-13 00:50:56 浏览:100
苹果和安卓哪个看小说方便 发布:2025-07-13 00:20:25 浏览:756
网址访问量查询 发布:2025-07-13 00:13:25 浏览:977
thinkphp关掉缓存 发布:2025-07-12 23:44:01 浏览:88