『壹』 求用java設計的簡單的登陸界面代碼
<%@ page language="java" pageEncoding="UTF-8"%>
<HTML>
<HEAD>
<TITLE>車友信息管理系統</TITLE>
<LINK href="images/public.css" type=text/css rel=stylesheet>
<LINK href="images/login.css" type=text/css rel=stylesheet>
<STYLE type=text/css>
</STYLE>
<script type="text/javascript">
function changeValidateCode(obj) {
//獲取當前的時間作為參數,無具體意義
var timenow = new Date().getTime();
//每次請求需要一個不同的參數,否則可能會返回同樣的驗證碼
//這和瀏覽器的緩存機制有關系,也可以把頁面設置為不緩存,這樣就不用這個參數了。
obj.src="rand.action?d="+timenow;
}
</script>
</HEAD>
<BODY onload="fon()">
<form id=login name="fr" method="post" action="loginpurview"
onsubmit="return func()">
<DIV id=div1>
<TABLE id=login height="100%" cellSpacing=0 cellPadding=0 width=800
align=center>
<TBODY>
<TR id=main>
<TD>
<TABLE height="100%" cellSpacing=0 cellPadding=0 width="100%">
<TBODY>
<TR>
<TD colSpan=4>
</TD>
</TR>
<TR height=30>
<TD width=380>
</TD>
<TD>
</TD>
<TD>
</TD>
<TD>
</TD>
</TR>
<TR height=40>
<TD rowSpan=4>
</TD>
<TD>
用戶名:
</TD>
<TD>
<INPUT class=textbox id="txtUserName" type="text" name="username">
</TD>
<TD width=120>
</TD>
</TR>
<TR height=40>
<TD>
密 碼:
</TD>
<TD>
<INPUT class=textbox id=txtUserPassword type="password"
name="password">
</TD>
<TD width=120>
</TD>
</TR>
<TR height=40>
<TD>
驗證碼:
</TD>
<td colspan="4" class="top_hui_text">
<input type="text" name="str" id="user2" style="width:100px; height:17px; background-color:#87adbf; border:solid 1px #153966; font-size:12px; color:#283439; " >
<img src="rand.action" onclick="changeValidateCode(this)" title="點擊圖片刷新驗證碼" /></td>
</TD>
</TR>
<TR height=40>
<TD align=left>
<div align="left"><INPUT id=btnLogin type=submit value=" 登 錄 " name=btnLogin/></div>
</TD>
<TD align=center>
<div align="center"><INPUT id=btnLogin1 type=reset value=" 重置 " name=btnLogin1 onclick="return reset1()"/></div>
</TD>
<TD align=right>
<div align="right"><a href="register.jsp">注冊</a></div>
</TD>
<TD width=120>
</TD>
</TR>
<TR height=110>
<TD colSpan=4>
</TD>
</TR>
</TBODY>
</TABLE>
</TD>
</TR>
<TR id=root height=104>
<TD>
</TD>
</TR>
</TBODY>
</TABLE>
</DIV>
<DIV id=div2 style="DISPLAY: none"></DIV>
</CONTENTTEMPLATE>
</form>
</BODY>
</HTML>
<script>
function func(){
var username = fr.username.value;
var password = fr.password.value;
if(username==""){
alert("用戶名不能為空");
return false;
}else if(password==""){
alert("密碼不能為空");
return false;
}else if(username.indexOf("'")!=-1)
{
alert("您的用戶名中含有非法字元,請重新輸入");
return false;
}
else if(password.indexOf("'")!=-1)
{
alert("您的密碼中含有非法字元,請重新 輸入");
return false;
}else
{
return form_submit();
}
}
function reset1()
{
fr.reset();1
return false;
}
</script>
一個完整的jsp頁面,直接復制就行
『貳』 誰有登錄的網站源碼
JSP登陸系統 源代碼 很好的源代碼
<!-- 該Login頁面是一個簡單的登錄界面 -->
<!--
該JSP程序是用來測試與MySQL資料庫的連接,
需要一個資料庫:LearnJSP,和其中一個表:userinfo
表中有兩個欄位分別為:UserName varchar (20) not null,UserPwd varchar (20) not null
-->
<html>
<head>
<title>登錄</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Language" content="ch-cn">
</head>
<body>
<!-- Form 用來提取用戶填入並提交的信息-->
<form method="post" name="frmLogin" action="LoginServlet">
<h1 align="center">用戶登錄</h1><br>
『叄』 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>
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登陸界面代碼
實現這個功能要兩個網頁,一個是前台靜態網頁,用兩個文本框分別為t1,t2,一個按鈕active後面寫上你要跳轉的後台網頁的名稱如"houtai.asp"
以下是houtai.asp的代碼
<%
dim
a,b
a=request.from("t1")
b=request.from("t2")
if
a<>admin
then
response.write
"用戶名錯誤"
else
if
b<> 123456
then
response.write
"密碼錯誤"
else
response.redirect
"你要轉到的主頁.asp"
end
if
end
if
%>
『伍』 求一個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>
『陸』 求c#注冊登錄界面源代碼(全部包括SQL資料庫)
我寫了一個登錄的程序,界面也做的還可以,寫了號幾天呢。20分把這么多代碼寫給你不太可能吧,這里也放不下
『柒』 asp登錄界面源代碼
要是你要的話。我可以發一個文件給你。裡面的內容是一本書的所有例子。包括有
「留言板、注冊和登陸、Blog、小型論壇、新聞發布等等。」
都是ASP版的。只要你建好站點。復制相應的文件到你站點下就行了。
『捌』 求一個:最簡單的asp登陸界面代碼
<form id="form1" name="form1">
用戶名:<input type="text" id="UserName" name="UserName">
密 碼:<input type="password" id="PassWord" name="PassWord">
<input type="button" value="提交" onclick="javascript:if
(document.all.UserName.value!='suchen' && document.all.PassWord.value!
='suchen'){alert('用戶名或密碼有誤!')}else
{location.href='http://hi..com/ken_fly';}">
</form>
因為你沒有資料庫的,所以其實用這個就行了,不用那麼麻煩,
把「suchen"和那個http://hi..com/ken_fly改為你想要的就行。
呵呵。把它復制到別的地方比較看得清。這里這個寬度太小,不好看!
設計的話,要你自己根據你的頁面設計,在這里我就幫不了你了,只能給你源碼。呵呵!
『玖』 網頁設計,淘寶網的登入界面的源代碼怎麼寫急急急...
哎,這個告訴你,你用谷歌瀏覽器,登陸這個界面。然後右鍵,審查元素,就會看到一大片源碼,找到這個部分的代碼!你要是一點也不會,那你就好好看看html,css,兩天吧,就會寫!