當前位置:首頁 » 操作系統 » 登陸界面源碼下載

登陸界面源碼下載

發布時間: 2022-09-20 10:47:56

『壹』 求一個php的登陸源碼。功能簡單就行

index.php
<html>
<head>
<title>登錄界面</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<?php
//將用戶提交的用戶名和密碼和資料庫中的用戶名和密碼逐一比對,如正確,則進入2.php,錯誤則提示錯誤。
$username=$_post['username'];
$password=$_post['password'];
$sql="select * from userinfo where username='$username' and password='$password'";
$re=mysql_query($sql);
$row=mysql_num_rows[$re];
if(!$row){
echo "<script>alert('用戶名或密碼錯誤!');history.back(-1);</script>";
}
else {
echo '用戶登錄成功!';
echo '<meta http-equiv=refresh content=2;url=2.php>';
}
?>
<form name="login" method="post" action="index.php">
用戶名:<input type="text" name="username" /><br/>
密碼:<input type="password" name="password" /><br/>
<input type="submit" name="submit" value="登錄">
</form>
</body>
<html>

『貳』 asp登錄界面源代碼

要是你要的話。我可以發一個文件給你。裡面的內容是一本書的所有例子。包括有
「留言板、注冊和登陸、Blog、小型論壇、新聞發布等等。」
都是ASP版的。只要你建好站點。復制相應的文件到你站點下就行了。

『叄』 一個登陸界面(關於C#Winform)源碼身份是:管理者和駕駛員。並求資料庫的連接。

這個,無非都是些if條件語句判斷而已嘛,這個很難么?
首先我想說 杜玉二 同學,你真心不懂ADO.NET和C#編程嗎?
要做到你所說的功能其實只需要掌握最基本的C#和ADO編程即可完成。下面說一下簡單的思路:
1、建立一個Windows項目,通過拖拽相應控制項來完成你給的截圖界面。
2、打開Form1.cs(假設你沒改名字),雙擊登錄按鈕(假設按鈕名字為btnLogin)
在Form1.cs的代碼視圖里,在頭部引入ADO資料庫提供程序的相關類庫,語句如下:
using System.Data;
using System.Data.SqlClient;
3、在btnLogin_Click事件處理方法裡面編寫以下語句:
//解釋樓上(1)難點
string conStr ="Data Source=資料庫伺服器IP;Initial Catalog=資料庫名字;User Id=資料庫登錄名;Password=登錄密碼; ";

SqlConnection conn = new SqlConnection(conStr);
conn.Open();
SqlCommand comm = new SqlCommand();
comm.Connection=conn;
//解釋樓上(2)難點,
comm.CommandText="select count(*) from Login where [username]=@userName and [password]=@password and [usersort]=@usersort";
//解釋樓上(3)難點,參數化查詢方式,可以防止SQL注入
comm.Parameters.Add(new SqlParameter("@userName",從前台獲取的用戶名字元串));
comm.Parameters.Add(new SqlParameter("@password",從前台獲取的用戶密碼字元串));
comm.Parameters.Add(new SqlParameter("@usersort",從前台獲取的用戶類型字元串));
//查詢資料庫
int result = Convert.ToInt32(comm.ExecuteScalar());
if(result>0)
MessageBox.Show("登陸成功");
else
MessageBox.Show("登陸失敗");
conn.Close();
如果要對用戶登錄錯誤類型進行細分,這個簡單得很,寫幾個不同類型的SQL,或者是將用戶數據抽出來,與界面作對比就行了。

特殊說明:以上代碼純屬手打,沒有經過編譯,也許存在少許錯誤,請諒解,重點看意思。

『肆』 用戶登錄 asp+sql源碼

資料庫建立一個表admin 3個列:Username Passwd oskey(用戶級別)
ODBC數據源創建一個sql的數據源與你建立的資料庫連上。
conn.asp
<%
set conn=server.createobject("adodb.connection")
conn.connectionstring="DSN=ccsw;uid=sa;pwd=1234"
conn.open
%>
index.asp
<html>

<head>
<title>管理登錄</title>
<link rel="stylesheet" href="style.CSS">
<style type="text/css">
<!--
.style1 {color: #9966FF}
.style2 {
font-size: 12pt;
font-weight: bold;
color: #9966FF;
}
.style3 {
font-size: 12pt;
color: #0033CC;
}
.style4 {color: #0000CC}
-->
</style>
</head>

<body>
<div align="center"><center>

<table border="0" cellspacing="1" width="90%">
<tr>
<td> <form method="post" action="chklogin.asp">
<table width="300" border="0" cellspacing="1" cellpadding="0" align="center" bgcolor="#000000">
<tr bgcolor="#FFFFFF">
<td>
<table width="100%" border="0" cellspacing="1" cellpadding="1">
<tr>
<td height="30" colspan="2" align="right"><div align="center" class="style1 style3"><strong>管理登錄</strong></div></td>
</tr>
<tr>
<td width="33%" align="right" height="30"><span class="style4">用戶名:</span></td>
<td width="67%">
<input name="UserName" maxlength="20" class="smallInput" size="20">
</td>
</tr>
<tr>
<td width="33%" align="right" height="30"><span class="style4">密 碼:</span></td>
<td width="67%">
<input type="password" name="Passwd" maxlength="16" class="smallInput"
size="20">
</td>
</tr>
<tr>
<td colspan="2" height="15"></td>
</tr>
</table>
</td>
</tr>
<tr align="center" bgcolor="#FFFFFF">
<td height="31" bgcolor="#9999FF">
<input type="submit" name="Submit" value="確定" class="buttonface">

<input type="reset" name="Submit2" value="重寫" class="buttonface"></td>
</tr>
</table>
</form>
<p align="center">後台登錄</td>
</tr>
</table>
</center></div>
</body>
</html>
檢查用戶界面:
<!--#include file=articleconn.asp-->
<%
dim rs
UserName1=request.form("UserName")'獲得登錄界面輸入的用戶名
Passwd1=request.form("PassWd")''獲得登錄界面輸入的密碼
set rs=server.CreateObject("ADODB.RecordSet")'建立資料庫連接
rs.open "select * from admin where UserName='" & UserName1 & "' and passwd='"&passwd1&"'",conn,1 '查詢該用戶名和密碼是否存在
if rs.eof or rs.bof then '當沒有符合篩選結果時,則執行下面的句子
response.write "<script language=javascript>"
response.write "alert('用戶或密碼不對!');"
response.write "javascript:history.go(-1);"
response.write "</script>" '用javascript腳本提示用戶
else '如果符合條件的時候
session("UserName")=RS("Username") '新建session,值等於表單傳來的用戶名
session("KEY")=rs("OSKEY")
response.write"<SCRIPT language=JavaScript>alert('登錄成功');"
response.write"this.location.href='admin.asp';</SCRIPT>"
end if '結束if語句
%>

『伍』 網頁設計,淘寶網的登入界面的源代碼怎麼寫急急急...

哎,這個告訴你,你用谷歌瀏覽器,登陸這個界面。然後右鍵,審查元素,就會看到一大片源碼,找到這個部分的代碼!你要是一點也不會,那你就好好看看html,css,兩天吧,就會寫!

『陸』 求一個android 登錄界面源碼,美觀漂亮的

還是自己搜一下吧,很多android開發論壇都有人提供源碼下載的。比如仿QQ等等。

『柒』 jsp登陸界面源代碼

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>

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

}

}

}

『捌』 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>

(8)登陸界面源碼下載擴展閱讀:

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>

熱點內容
內置存儲卡可以拆嗎 發布:2025-05-18 04:16:35 瀏覽:336
編譯原理課時設置 發布:2025-05-18 04:13:28 瀏覽:378
linux中進入ip地址伺服器 發布:2025-05-18 04:11:21 瀏覽:612
java用什麼軟體寫 發布:2025-05-18 03:56:19 瀏覽:32
linux配置vim編譯c 發布:2025-05-18 03:55:07 瀏覽:107
砸百鬼腳本 發布:2025-05-18 03:53:34 瀏覽:945
安卓手機如何拍視頻和蘋果一樣 發布:2025-05-18 03:40:47 瀏覽:742
為什麼安卓手機連不上蘋果7熱點 發布:2025-05-18 03:40:13 瀏覽:803
網卡訪問 發布:2025-05-18 03:35:04 瀏覽:511
接收和發送伺服器地址 發布:2025-05-18 03:33:48 瀏覽:372