1、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>
<script>
function r()
{
var username=document.getElementById("username");
var pass=document.getElementById("password");
if(username.value=="")
{
alert("請輸入用戶名");
username.focus();
return;
}
if(pass.value=="")
{
alert("請輸入密碼");
return;
}
return true;
}
</script>
</head>
<body>
<form>
<table width="350" bgcolor="#ccffcc" style="border-color" border="1">
<tr align=center>
<td>用戶名</td><td><input type="text" name="username" id="username"></td>
</tr>
<tr align=center><td>密 碼</td><td><input type="password" name="password" id="password"></td></tr>
<tr align=center><td>驗證碼</td><td><input type="text" name="yanzheng"></td></tr>
<tr align=center><td colspan="2"><input type="button" value="登 錄" onclick="r();"/> <input type="reset" value="重 置"/></td></tr>
</table>
</form>
</body>
</html>
2、html網頁設計:一個簡單的登錄界面代碼!
<input
type='button'
text='登陸'
onclick='return
checknull()'>你說的要能識別是否輸入了用戶名和密碼!需要用腳本來驗證
<script>
function
checknull()
{
var
a=document.getElementById('用戶名文本框ID').text;
var
b=document.getElementById('密碼文本框ID').text;
if(a.length>0&&b.length)
return
true;
else
return
false;
}
<script>
3、求網頁製作 注冊\登錄代碼!!
是要用什麼樣的方式、jsp/asp/php等
4、html頁面驗證用戶名和密碼並且點擊自己製作的登陸按鈕跳轉到另外一個頁面
HTML頁面用 script 驗證不是必須要用 form 的,可以直接給頁面里的 DOM 對象定義 id 屬性,用 javascript 操作 DOM 對象即可。
針對您提的問題想要實現的效果,下面說說不用 form 表單和資料庫來實現用戶名和密碼驗證的方法:
1、首先,給 HTML 頁面里的用戶名和密碼輸入框都定義一個id屬性,例如:
用戶名:<input type="text" id="username" value="">
密 碼:<input type="password" id="password" value="">
2、其次,放置一個按鈕 <button type="button" name="chkBtn" id="chkBtn"> 登錄</button>
3、編寫 javascript 腳本代碼,主要思路如下:
(1)為按鈕增加一個 click 的監聽,當滑鼠點擊該按鈕時執行;
(2)獲取 input 用戶名和密碼輸入框的輸入值;
(3)驗證輸入值是否符合要求;
(4)符合要求頁面跳轉到設置的指定頁面;
(5)不符合要求提示用戶輸入錯誤。
4、最後,在瀏覽器里運行該頁面,測試一下效果。完整代碼如下圖所示。
(4)網頁設計製作用戶注冊頁面代碼擴展資料
1、document.getElementById(); 通過 ID 獲取元素的用法
網頁 HTML 由標簽將信息組織起來,而標簽的 id 屬性值是唯一的,就像是每人有一個身份證號一樣,只要通過身份證號就可以找到相對應的人。那麼在網頁中,我們通過id先找到標簽,然後進行操作。
2、innerHTML 屬性
語法:Object.innerHTML,innerHTML 屬性用於獲取或替換 HTML 元素的內容。
注意:
(1)Object是獲取的元素對象,如通過document.getElementById("ID")獲取的元素;
(2)注意書寫,innerHTML區分大小寫。
3. value 屬性
語法 Object.value,value 屬性用於獲取或替換 HTML 元素的value屬性中的內容。
5、dw製作網頁中的注冊登錄代碼怎麼寫?
可以 用.net或者php或者asp都可以實現的,前台你不知道哪些頁面跳轉,現在的網頁都是動態的,鏈接都是後台調用 ,他們自己分配的id咱不知道,所以你也不知道鏈接到什麼地發過去,即使你鏈接了也是靜態的,可以用一個id控制項點擊跳轉
6、網頁設計里的注冊源代碼
是jsp嗎,還是asp什麼的
首先資料庫連接沒問題,且庫中有測試用戶名和密碼,我這里有一個拿去參考吧~
輸入頁面加入<from>表單,將用戶輸入內容提交到validation.jsp進行驗證。
<form name="myform" action="validation.jsp" method="post">
<table cellSpacing="0" cellPadding="0" width="100%" border="0" height="143" id="table212">
<tr>
<td width="13%" height="38" class="top_hui_text"><span class="login_txt">用戶: </span></td>
<td height="38" colspan="2" class="top_hui_text"><input name="username" class="editbox4" value="" size="20"> </td>
</tr>
<tr>
<td width="13%" height="35" class="top_hui_text"><span class="login_txt"> 密碼: </span></td>
<td height="35" colspan="2" class="top_hui_text"><input name="userpass" class="editbox4" type="password" size="20" >
<img src="images/luck.gif" width="19" height="18"> </td>
</tr>
<td height="35" > </td>
<td width="10%" height="35" ><input name="Submit" type="submit" class="button" id="Submit" value="登 陸" onclick="return valid()"> </td>
<td width="80%" class="top_hui_text"><input name="cs" type="reset" class="button" id="cs" value="取 消"></td>
</tr>
</table>
<br>
</form>
然後第二個頁面validation.jsp接收數據,驗證通過後進入其他頁面,比如'login.jsp'
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>活動日誌</title>
</head>
<%//接收客戶端提交的數據
String username=request.getParameter("username");
String pass=request.getParameter("userpass");
try{
ResultSet rs=inBean.executeQuery("select * from employees where emp_name='"+username+"' and emp_pwd='"+pass+"'");//執行SQL語句並返回結果
if(rs.next())
{ out.print("<script>window.location='login.jsp' </script>");
}
else{
// out.print("登陸失敗");
out.print("<script>alert('用戶名或密碼錯誤,請重新登錄...'); window.location='index.jsp' </script>");
// response.sendRedirect("index.jsp.html");
}
//rs.close();
rs.close();
}
catch(SQLException e1){out.println("SQL異常!");}
%>
<%session.setAttribute("userinfo", username); %>
<body>
</form>
</body>
</html>
7、網頁製作中登陸界面設計代碼
<%@language=vbscript codepage=936 %>
<%
option explicit
'強制瀏覽器重新訪問伺服器下載頁面,而不是從緩存讀取頁面
Response.Buffer = True
Response.Expires = -1
Response.ExpiresAbsolute = Now() - 1
Response.Expires = 0
Response.CacheControl = "no-cache"
'主要是使隨機出現的圖片數字隨機
%>
<html>
<head>
<title>管理員登錄</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="Admin_Style.css">
<script language=javascript>
function SetFocus()
{
if (document.Login.UserName.value=="")
document.Login.UserName.focus();
else
document.Login.UserName.select();
}
function CheckForm()
{
if(document.Login.UserName.value=="")
{
alert("請輸入用戶名!");
document.Login.UserName.focus();
return false;
}
if(document.Login.Password.value == "")
{
alert("請輸入密碼!");
document.Login.Password.focus();
return false;
}
//if (document.Login.CheckCode.value==""){
// alert ("請輸入您的驗證碼!");
// document.Login.CheckCode.focus();
// return(false);
}
}
</script>
</head>
<body onLoad="SetFocus();">
<p> </p>
<form name="Login" action="Admin_ChkLogin.asp" method="post" target="_parent" onSubmit="return CheckForm();">
<table width="300" border="0" align="center" cellpadding="5" cellspacing="0" class="border" >
<tr class="title">
<td colspan="2" align="center"> <strong>管理員登錄</strong></td>
</tr>
<tr>
<td height="120" colspan="2" class="tdbg">
<table width="250" border="0" cellspacing="8" cellpadding="0" align="center">
<tr>
<td align="right">用戶名稱:</td>
<td><input name="UserName" type="text" id="UserName2" size="23" maxlength="20"></td>
</tr>
<tr>
<td align="right">用戶密碼:</td>
<td><input name="Password" type="password" size="23" maxlength="20"></td>
</tr>
<tr>
<td align="right">驗 證 碼:</td>
<td><input name="CheckCode" size="15" maxlength="6">
1109 </td>
</tr>
<tr>
<td colspan="2"> <div align="center">
<input type="submit" name="Submit" value=" 確認 ">
<input name="reset" type="reset" id="reset" value=" 清除 ">
<br>
</div></td>
</tr>
</table>
</td>
</tr>
</table>
<p align="center">後台管理頁面需要屏幕解析度為 <font color="#FF0000"><strong>1024*768</strong></font>
或以上才能達到最佳瀏覽效果!<br>
需要瀏覽器為<strong><font color="#FF0000"> </font></strong><font color="#FF0000"><strong>IE5.5</strong></font>
或以上版本才能正常運行!!!</p>
</form>
</body>
</html>
8、網頁製作中用戶注冊登錄系統代碼如何連接到網頁上?
<html ><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><script language="jscript">function check() if(pass.length<6||name.length<6) for(var i = 0;i<name.length;i++) } return true;}</script><title>css樣式特效</title><style type="text/css">table.mouseOverStyle.mouseOver.mouseOut</style></head><body><form name="myform" method="post" action="a.htm" onSubmit="return check()"> <table border="0" bgcolor="#F8F8F8" style="border-style:solid; border-width:1px;"> <tr> <td colspan="2"><img src="img/excer/images1/freeh1-n.jpg" alt="1" ></td> </tr> <tr> <td width="72"><label></label> <div align="right">用戶名:</div></td> <td width="240"><label> <input type="text" name="txtN" style="border-color='#00a8a8'" onMouseOver="this.style.borderColor='#ffa346';" onMouseOut="this.style.borderColor='#00a8a8'"> </label> <br>名字由字母和數字組成</td> </tr> <tr> <td><div align="right">密碼:</div></td> <td><label> <input type="password" name="txtP" style=" border-color:#00a8a8" onMouseOver="this.style.borderColor='#ffa346';" onMouseOut="this.style.borderColor='#00a8a8'" > </label> </td> </tr> <tr> <td> </td> <td><label>密碼長度6位以上</label></td> </tr> <tr> <td> </td> <td><label> <input type="submit" name="Submit" value=" 登錄 " class="mouseOverStyle" onMouseOver="this.className='mouseOver'" onMouseOut="thi 如果幫助到您,請記得採納為滿意答案哈,謝謝!祝您生活愉快! vae.la