當前位置:首頁 » 操作系統 » 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 00:13:25 瀏覽:976
thinkphp關掉緩存 發布:2025-07-12 23:44:01 瀏覽:86
互動平台源碼 發布:2025-07-12 23:42:15 瀏覽:9
矩形密碼是什麼 發布:2025-07-12 23:41:15 瀏覽:407
kvm存儲技術包括 發布:2025-07-12 23:41:15 瀏覽:950
安卓手機網路怎麼設置才好 發布:2025-07-12 23:33:01 瀏覽:272
怎麼修改手機號服務密碼 發布:2025-07-12 23:29:37 瀏覽:158
myeclipsejsp資料庫連接 發布:2025-07-12 23:26:25 瀏覽:553
凱迪拉克ct6電磁懸掛是哪個配置 發布:2025-07-12 23:24:38 瀏覽:597
linuxnginx重啟 發布:2025-07-12 23:11:00 瀏覽:803