登錄注冊界面
1. 如何用eclipse寫登錄注冊頁面的代碼
java寫的用戶登錄實例,實際頁面展示使用的jsp,那麼下面是的登錄頁面代碼:
1、login.jsp代碼
<%
string name = request.getparameter("username");
string pwd = request.getparameter("password");
//out.println(name+pwd);
string sql ="select * from info where username='"+name+"' and password='"+pwd+"'";
//out.println(sql);
statement stm= null;
resultset rs =null;
try
{
stm = conn.createstatement();
rs = stm.executequery(sql);
if(rs.next())
{
session.setattribute("username",name);
response.sendredirect("index.html");
}
else
{
response.sendredirect("index1.html");
}
}
catch(sqlexception e)
{
e.printstacktrace();
}
%>
<!--登錄的表單-->
<form name="form1" method="post" action="login.jsp">
<p>
<label for="username"></label> 用戶名
<input type="text" name="username" id="username">
</p>
<p>
<label for="passwrod"></label> 密碼
<input type="text" name="passwrod" id="passwrod">
</p>
<p>
<input type="submit" name="button" id="button" value="提交">
</p>
</form>
2、用戶信息表,存放用戶名和密碼:
user_info 表
create table if not exists `test` (
`id` int(8) not null auto_increment,
`username` char(150) default null,
`password` varchar(32),
`times` int(4) not null,
primary key (`id`)
) engine=myisam default charset=utf8 auto_increment=1 ;
2. 進入微信的登錄,注冊頁面
進入微信的抄登錄和注冊頁面的方法是點擊手機上的微信軟體進入。出現的頁面即為其登錄界面,然後點擊更多,選擇注冊即可進入到微信的注冊界面。具體的以OPPO手機為例,進入方法如下:
1、在手機上點擊微信軟體進入。
3. java web怎麼實現注冊登錄界面
資料庫存放賬號密碼,然後頁面傳登錄的用戶密碼,用SQL去資料庫取一下,存在就成功,否則就失敗
4. 如何進行從登錄界面中的用戶注冊頁面的跳轉到注冊界面asp.net
需自備mac
osx
,
xcode
,
node
以及
npm
。
做好准備之後,打開終端(或其他命令行利器),鍵入下面命令:
npm
install
-g
react-native-cli
和
react-native...
5. 網頁的登錄界面和注冊頁面一般是怎麼編寫用html
一般登錄界面用html寫
因為登錄界面沒有太多的花哨
一般很簡單
只是一個框架
表單提交用
跳到一個jsp頁面去處理
如果正確就跳轉到你想要到的界面
jsp可以通過
會話
或cookie或上下文、url等把頁面聯系起來
資料庫
一般用mysql
注冊判斷的地方用js聯系資料庫就可以了
很簡單的
6. 注冊/登陸頁面HTML代碼該怎麼寫
以下為個人原創教學例子,任何人引用需註明出自網路知道用戶am7972,樓主可供參考
該例子涵蓋了文本框、密碼框、下拉菜單、單選框、復選框及文本區的使用
同時在數據的使用方面涵蓋了文本型、數值型、日期型、布爾型的使用
也涵蓋了在會員信息入資料庫前,進行嚴格的數據檢查
不足處,JS驗證還不是太完善,不過有服務端認證足夠了
<title>會員注冊</title>
<script type="text/javascript">
<!--function CheckForm()
{
if(document.userinfo.username.value == "")
{ alert("請輸入姓名,姓名不能為空!");
document.userinfo.username.focus();
return false;
}
if(document.userinfo.username.value.length > 10)
{
alert("輸入的姓名長度最多為10個字元!");
document.userinfo.username.focus();
return false;
}
}
//--></script>
</head>
<body>
<table border="1" width="53%" bordercolorlight="#000000" cellspacing="0" id="table1" height="358" bordercolor="#000000" bordercolordark="#FFFFFF" cellpadding="0">
<form method="POST" action="bb.asp" name="userinfo" onsubmit="return CheckForm();">
<tr><td colspan="2" height="37"> <p align="center">會員注員</td> </tr>
<tr> <td width="37%" align="right">姓名:</td> <td width="61%"> <input type="text" name="username" value="libin" size="13"> </td> </tr>
<tr> <td width="37%" align="right">密碼:</td> <td width="61%"> <input type="password" name="userPassword" size="20" value="123"></td> </tr>
<tr> <td width="37%" align="right">性別:</td> <td width="61%"><input type="radio" value="True" checked name="Sex">男 <input type="radio" name="Sex" value="False">女</td> </tr>
<tr> <td width="37%" align="right">生日:</td> <td width="61%"> <input type="text" name="userSR" size="11" value="1985-03-12"></td> </tr>
<tr> <td width="37%" align="right">年齡:</td> <td width="61%"><input type="text" name="userNL" size="9" value="13"></td> </tr>
<tr> <td width="37%" align="right">愛好:</td> <td width="61%"> <input type="checkbox" name="ah" value="sw">上網 <input type="checkbox" name="ah" value="ds" checked>讀書 <input type="checkbox" name="ah" value="ty">體育</td> </tr>
<tr> <td width="37%" align="right">上網方式:</td> <td width="61%">
<select size="1" name="swfs"> <option selected value="bhsw">撥號上網</option> <option value="wxsw">無線上網</option> <option value="gxsw">光纖上網</option> </select>
</td> </tr>
<tr> <td width="37%" align="right">個人簡介:</td> <td width="61%"><textarea rows="9" name="userGrjs" cols="34"></textarea></td> </tr> <tr> <td colspan="2" height="38"> <p align="center"><input type="submit" value="提交" name="B1"> <input type="reset" value="重置" name="B2"></td>
</tr>
</form>
</table>
====bb.asp的會員注冊非法數據監測====
<%
username = Request("username")
userPassword = Request("userPassword")
Sex = Request("Sex")
userSR = Request("userSR")
userNL = Request("userNL")
ah = Request("ah")
swfs = Request("swfs")
userGrjs = Request("userGrjs")
'判斷數據合法性,絕對不能讓非法數據進入系統
'判斷姓名username合不合法,是否包含非法數據
username = Trim(username) '例如:" 張 三 "經過處理之後變成"張 三"
If username ="" Then
Response.write "姓名不能為空"
Response.End
End If
If Len(username)>10 Then
Response.write "姓名字數不能超過10個字" 'Len("Z")=1 Len("國")=2
Response.End
End If
For i = 1 To Len(username)
q = Mid(username,i,1)
If InStr("!@#$%^&*()_-+|<>?/"",.",q)>0 Then
Response.write "姓名不能包含特殊符號!@#$%^&*()_-+|<>?/"",."
Response.End
End If
Next
'判斷密碼合不合法,是否包含非法數據userPassword = Trim(userPassword)If userPassword ="" Then Response.write "密碼不能為空" Response.EndEnd If
If Len(userPassword)>20 Then
Response.write "密碼字數不能超過20個字"
Response.End
End If
'判斷密碼合不合法,是否包含非法數據
Sex = Trim(Sex)
If Sex = "" Then
Response.write "性別不能為空"
Response.End
End If
If Sex <> "True" And Sex <> "False" Then
Response.write "性別不能為不男不女"
Response.End
End If
'判斷生日合不合法,是否包含非法數據
userSR = Trim(userSR)
If userSR ="" Then
Response.write "生日不能為空"
Response.End
End If
If Len(userSR)<8 Or Len(userSR)>10 Then '例如:2012-6-3 2012-11-23
Response.write "你輸入的生日字數不對,應為2012-6-3或2012-11-23格式"
Response.End
End If
If IsDate(userSR)=False Then
Response.write "你輸入的生日格式不能轉化為日期,請核實"
Response.End
End If
If DateDiff("yyyy",userSR,Date())<1 Or DateDiff("yyyy",userSR,Date())>200 Then
Response.write "根據你輸入的生日你可能小於1歲或已經超過200歲了,請核查重新輸入"
Response.End
End If
'判斷年齡合不合法,是否包含非法數據userNL = Trim(userNL)If userNL ="" Then
Response.write "年齡不能為空"
Response.End
End If
If IsNumeric(userNL)=False Then
Response.write "你輸入的年齡不能轉化為數值,請核查"
Response.End
End If
userNL = CInt(userNL)
If userNL<0 Or userNL>200 Then
Response.write "你輸入的年齡不能小於0歲或者大於200歲,請核查"
Response.End
End If
'判斷愛好合不合法,是否包含非法數據ah = Trim(ah) '選擇多個愛好則系統會用,分開 //測試
ah = Replace(ah," ","")
arrAh = Split(ah,",")
For i = LBound(arrAh) To UBound(arrAh)
If arrAh(i)<>"sw" And arrAh(i)<>"ds" And arrAh(i)<>"ty" Then
Response.write i & "你選擇的愛好有問題,請核查" & arrAh(i)
Response.End
End If
Next
'判斷上網方式合不合法,是否包含非法數據swfs = Trim(swfs)If swfs = "" Then
Response.write "上網方式不能為空"
Response.End
End If
If swfs<>"bhsw" And swfs<>"wxsw" And swfs<>"gxsw" Then
Response.write "你選擇的上網方式有問題,請核查"
Response.End
End If
'判斷個人簡介是否為空,是否超出1000個字
userGrjs = Trim(userGrjs)
If userGrjs = "" Then
Response.write "個人簡介不能為空"
Response.End
End If
If Len(userGrjs) > 1000 Then
Response.write "個人簡介不能超過1000個字"
Response.End
End If
Response.write "數據合法性檢測通過"
%>
====登陸的HTML代碼可相信樓主參照會員注冊代碼應該沒問題了====
7. java登錄注冊界面不要資料庫
importjava.awt.GridLayout;
importjava.awt.event.ActionEvent;
importjava.awt.event.ActionListener;
importjava.io.Serializable;
importjavax.swing.JButton;
importjavax.swing.JFrame;
importjavax.swing.JLabel;
importjavax.swing.JPanel;
importjavax.swing.JPasswordField;
importjavax.swing.JTextField;
{
privateJLabelab1,ab2,ab3;
privateJTextFieldt1;
privateJPasswordFieldpass;
privateJButtonbt1,bt2,bt3;
privateJPaneljp1,jp2,jp3;
=16L;
SignIn(){
.setTitle("界面測試");
this.setLayout(newGridLayout(4,1));
this.setResizable(false);
this.setBounds(300,300,300,300);
this.setDefaultCloseOperation(3);
init();
this.setVisible(true);
}
privatevoidinit(){
ab1=newJLabel("網路知道XX系統",JLabel.CENTER);
ab2=newJLabel("昵稱:");
ab3=newJLabel("密碼:");
t1=newJTextField(15);
pass=newJPasswordField(15);
bt1=newJButton("登陸");
bt2=newJButton("退出");
bt3=newJButton("注冊");
jp1=newJPanel();
jp2=newJPanel();
jp3=newJPanel();
jp1.add(ab2);
jp1.add(t1);
jp2.add(ab3);
jp2.add(pass);
jp3.add(bt1);
jp3.add(bt2);
jp3.add(bt3);
event();
this.add(ab1);
this.add(jp1);
this.add(jp2);
this.add(jp3);
}
privatevoidevent(){
bt2.addActionListener(newActionListener(){
publicvoidactionPerformed(ActionEvente){
System.exit(1);
}
});
}
publicstaticvoidmain(String[]args){
newSignIn();
}
}
8. 動態html頁面。用html實現注冊和登錄的一些問題。
登錄頁面 login.html
<!doctypehtml>
<htmllang="en">
<head>
<metacharset="UTF-8">
<title>login</title>
<script>
window.addEventListener('load',function(){
varform=document.forms[0];
form.addEventListener('submit',function(e){
e.preventDefault();
varuserName=form.userName.value;
varpwd=form.pwd.value;
varuserInfo=JSON.parse(localStorage.getItem(userName));
if(userInfo&&userInfo.pwd===pwd)
returnalert('登錄成功!');
alert('登錄失敗請先注冊!');
});
document.getElementsByTagName('button')[0].addEventListener('click',function(e){
e.preventDefault();
location.href='regist.html';
});
});
</script>
</head>
<body>
<formaction="#">
<inputname="userName"type="text"placeholder="賬戶名"required>
<inputname="pwd"type="password"placeholder="密碼"required>
<inputtype="submit"value="登錄">
<button>注冊</button>
</form>
</body>
</html>
注冊頁面 regist.html
<!doctypehtml>
<htmllang="en">
<head>
<metacharset="UTF-8">
<title>regist</title>
<script>
window.addEventListener('load',function(){
varform=document.forms[0];
vargetUserInfo=function(){
varvalue={};
for(vari=0,len=form.elements.length;i<len;i++){
varel=form.elements[i];
if(/text|password/.test(el.type)){
value[el.name]=el.value;
}
}
returnvalue;
};
form.addEventListener('submit',function(e){
e.preventDefault();
varuserInfo=getUserInfo();
localStorage.setItem(userInfo.userName,JSON.stringify(userInfo));
alert('注冊成功!');
});
document.getElementsByTagName('button')[0].addEventListener('click',function(e){
e.preventDefault();
varvalue=getUserInfo();
varout=[];
for(varnameinvalue)
out.push(name+'='+value[name]);
alert(out.join(','));
});
});
</script>
</head>
<body>
<formaction="#">
<inputname="userName"type="text"placeholder="賬戶名"required>
<inputname="pwd"type="password"placeholder="密碼"required>
<inputname="confirmPwd"type="password"placeholder="確認密碼"required>
<inputtype="submit"value="注冊">
<button>驗證</button>
</form>
</body>
</html>
9. java編寫一個用戶注冊及登錄界面
mportjava.awt.HeadlessException;
importjava.awt.event.ActionEvent;
importjava.awt.event.ActionListener;
importjavax.swing.ImageIcon;
importjavax.swing.JButton;
importjavax.swing.JFrame;
importjavax.swing.JLabel;
importjavax.swing.JOptionPane;
importjavax.swing.JPanel;
importjavax.swing.JPasswordField;
importjavax.swing.JTextField;
@SuppressWarnings("serial")
{
JLabellbl1=newJLabel("用戶名:");
JLabellbl2=newJLabel("密碼:");
JTextFieldtxt=newJTextField("admin",20);
JPasswordFieldpwd=newJPasswordField(20);
JButtonbtn=newJButton("登錄");
JPanelpnl=newJPanel();
privateinterror=0;
publicMainFrame(Stringtitle)throwsHeadlessException{
super(title);
init();
}
privatevoidinit(){
this.setResizable(false);
pwd.setEchoChar('*');
pnl.add(lbl1);
pnl.add(txt);
pnl.add(lbl2);
pnl.add(pwd);
pnl.add(btn);
this.getContentPane().add(pnl);
btn.addActionListener(newActionListener(){
@Override
publicvoidactionPerformed(ActionEvente){
if("admin".equals(newString(pwd.getPassword()))){
pnl.removeAll();
JLabellbl3=newJLabel();
ImageIconicon=newImageIcon(this.getClass().getResource("pic.jpg"));
lbl3.setIcon(icon);
pnl.add(lbl3);
}
else{
if(error<3){
JOptionPane.showMessageDialog(null,"密碼輸入錯誤,請再試一次");
error++;
}
else{
JOptionPane.showMessageDialog(null,"對不起,您不是合法用戶");
txt.setEnabled(false);
pwd.setEnabled(false);
btn.setEnabled(false);
}
}
}
});
}
publicstaticvoidmain(String[]args){
MainFramefrm=newMainFrame("測試");
frm.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frm.setBounds(100,100,300,120);
frm.setVisible(true);
}
}
10. 如何修改登錄,注冊界面的顯示欄位
1. 在編輯模式下,打開【後台】->【用戶管理】->【基本配置】->【自定義欄位】內,在「用戶欄位分組」容下可以修改注冊界面、登錄界面、編輯個人資料等界面的顯示欄位。
2. 如果您想要修改某個條目,點擊它對應的"+";
3. 此處以"注冊欄位"為例(登錄、個人資料等界面欄位修改方法與此相同),點擊"+"後,將展開注冊欄位下對應的相關信息。
4. 點擊您所需修改欄位後面的設置按鈕;
5. 在標簽一欄中修改內容。例如,此處標簽一欄默認是「用戶名」,我將其改為「用戶名1」,點擊「保存」按鈕。
6. 刷新頁面後,此處欄位就變為上一步中修改的欄位了。
7. 點擊欄位後面的"x"可以刪除相應欄位,點擊紅色雪花符號可以設置該欄位為必填欄位。