當前位置:首頁 » 操作系統 » 注冊頁面源碼

注冊頁面源碼

發布時間: 2022-01-12 21:09:23

Ⅰ 表單注冊頁面代碼

誰會為那幾個沒什麼實際意義的網路分給你做這么累的事哦???

java注冊頁面代碼

很簡單,
建一個叫student的對象,然後給他幾個屬性。
存在一個list里就行了,
登錄的時候就便利這個list,發現有一樣的,就給他進去,沒有就報錯。

你用可以存key和valu的容器也行。

Ⅲ 網頁設計里的注冊源代碼

是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>

Ⅳ 網頁中加入用戶名、密碼、登陸及新用戶注冊源代碼

如果在網路中使用登陸機制一般都需要資料庫支持具體的代碼,特別是資料庫操作部分和自身的資料庫各表及欄位名稱有關,同時實現的方式還有很多特殊情況的處理,在這里很難提供,並且從安全的角度講,登陸與注冊也不易放置在同一頁面,同時還要有數據審核處理頁面,甚至可以說這需要一個系統。,建議你到免費的源代碼基地去找。

Ⅳ 求struts2的注冊頁面(含資料庫連接+插入數據)的源代碼,

首先是頁面
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<html>
<head>
<base href="<%=basePath%>">
<title>登錄頁面</title>
</head>
<body background="img/login.jpg">
<br>
<br>
<p><s:form action="login/loginAction.action" method="post">
<span></span> <s:textfield name="user.user_name" label="用戶名" />
<span></span> <s:password name="user.user_password" label="密碼" />
<!-- 用來防止重復提交 s:token-->
<s:token/><s:submit value="登錄"/><div align="center" ><a href="reg.jsp" title="想注冊~?快點我!!!"><h3>歡迎來到小八戒論壇<h3></a></div>
</s:form></p>
</body>
</html>

然後是Action
package net.bbs.login.action;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import net.bbs.login.bean.UserVO;
import net.bbs.login..LoginDaoInterface;
import net.bbs.system.ibatis.config.DaoConfig;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

@SuppressWarnings("serial")
public class LoginAction extends ActionSupport{
private UserVO user;

public UserVO getUser() {
return user;
}

public void setUser(UserVO user) {
this.user = user;
}

@SuppressWarnings("unchecked")
@Override
public String execute() throws Exception {
Map session = ActionContext.getContext().getSession();
String name = user.getUser_name();
String password = user.getUser_password();
user.setUser_name(name);
user.setUser_password(password);

LoginDaoInterface L = (LoginDaoInterface)DaoConfig.getDao(LoginDaoInterface.class);
List<UserVO> List = new ArrayList<UserVO>();
//將用戶信息存入到session中

List = L.Login(user);
if(List!=null&&List.size()>0){
session.put("user", List.get(0));
return SUCCESS;
}
return ERROR;
}

}

然後是 DAO
package net.bbs.login.;

import java.util.ArrayList;
import java.util.List;

import com.ibatis..client.DaoManager;

import net.bbs.base..BaseDaoImpl;
import net.bbs.login.bean.UserVO;
import net.bbs.system.ibatis.config.DaoConfig;

public class LoginDaoImpl extends BaseDaoImpl implements LoginDaoInterface{

public LoginDaoImpl(DaoManager Manager) {
super(Manager);
}

@SuppressWarnings({ "null", "unchecked" })
public List<UserVO> Login(UserVO user) {
List<UserVO> userList = new ArrayList<UserVO>();
try {
List<Object> L = selectList("login.SelectUser",user);

for(Object obj:L){
UserVO u = new UserVO();
u = (UserVO)obj;
userList.add(u);
}
return userList;
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return null;

}

public boolean addUser(UserVO user) {
try {
addInfo("login",user);
return true;
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return false;
}

}

Struts.xml 配置文件~~

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<package name="login" namespace="/login" extends="struts-default">
<action name="loginAction" class="net.bbs.login.action.LoginAction">
<result>/welcome.jsp</result>
</action>
</package>

</struts>

Ⅵ JS注冊頁面代碼

這不是源碼不源碼的事,這得看你用的是什麼技術,asp?php?JSP?能給你的只有Ajax的代碼,後台的得看你用的什麼技術。var xmlHttp;
try {
xmlHttp = new XMLHttpRequest();
} catch (trymicrosoft) {
try {
xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (othermicrosoft) {
try {
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (failed) {
xmlHttp = false;
}
}
}function getList(id) {
xmlHttp.open('POST', '<%=basePath%>displayWorkCharacterTree.do?id='+id,true);
xmlHttp.onreadystatechange = handleResponse;
xmlHttp.send(null);
}function handleResponse() { if(xmlHttp.readyState == 4){
if (xmlHttp.status == 200 || xmlHttp.status == 0){
alert("已經注冊"); }
}
}

Ⅶ 高價急求一個安卓程序(簡單的登陸界面和注冊界面)源碼和程序 教程也可以

1
MainActivity

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Button dengluButton =(Button)findViewById(R.id.button1);
Button zhuceButton=(Button)findViewById(R.id.button2);
final EditText yonghumingEditText=(EditText) findViewById(R.id.editText1);
final EditText mimaEditText=(EditText) findViewById(R.id.editText2);
zhuceButton.setOnClickListener(new OnClickListener() {

@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
Intent intent=new Intent();
intent.setClass(MainActivity.this, ZhuceActivity.class);
startActivity(intent);
}
});

dengluButton.setOnClickListener(new OnClickListener() {

@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
FileInputStream fis;
try {
fis = new
FileInputStream(Environment.getExternalStorageDirectory().getParent()+"/"+yonghumingEditText.getText().toString());
byte[] input =new byte[fis.available()];
while(fis.read(input)!=-1);
fis.close();
String mimastring=new String(input);
if (mimastring.equals(mimaEditText.getText().toString())==true) {
Toast.makeText(getApplicationContext(), new String(input),Toast.LENGTH_SHORT).show();
String mimaString= new String(input);
if (mimastring.equals(mimaEditText.getText().toString())==true) {
Toast.makeText(getApplicationContext(), "成功登陸", Toast.LENGTH_SHORT).show();
Intent intent =new Intent();
intent.setClass(MainActivity.this,ZhuceActivity.class );
startActivity(intent);

}
else {
Toast.makeText(getApplicationContext(), "用戶名或密碼錯誤", Toast.LENGTH_SHORT).show();

}
}
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Intent intent=new Intent(MainActivity.this,AbActivity.class);
startActivity(intent);

}

});
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}

}

2. ZhuceActivity

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_zhuce);
Button zhucebingfanhuiButton = (Button) findViewById(R.id.button1);
final EditText yonghumingEditText=(EditText) findViewById(R.id.editText1);
final EditText mimaEditText=(EditText) findViewById(R.id.editText2);

zhucebingfanhuiButton.setOnClickListener(new OnClickListener() {

@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
File writeFile=new File(Environment.getExternalStorageDirectory().getPath(),yonghumingEditText.getText().toString());
if (!writeFile.exists()) {
try {
writeFile.createNewFile();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

}
String abcString =mimaEditText.getText().toString();
FileOutputStream fos;
try {
fos=new FileOutputStream(writeFile);
fos.write(abcString.getBytes());
fos.flush();
fos.close();
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Intent intent= new Intent();
intent.setClass(ZhuceActivity.this, MainActivity.class);
startActivity(intent);
}
});
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.zhuce, menu);
return true;
}

}

三、
package com.example.zhuanhuan;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

import com.example.zhuanhuan.MainActivity;
import com.example.zhuanhuan.R;
import android.os.Bundle;
import android.os.Environment;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;

public class KkkActivity extends Activity {

private File writeFile;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.kkk);
Button backButton = (Button) findViewById(R.id.button1);
final EditText yonghumingEditText = (EditText) findViewById(R.id.editText1);
final EditText mimaEditText = (EditText) findViewById(R.id.editText2);

backButton.setOnClickListener(new OnClickListener() {

@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub

File writeFile = new File(Environment.getExternalStorageDirectory().getPath(), yonghumingEditText.getText().toString());
if (!writeFile.exists()) {

try {
writeFile.createNewFile();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

}

String abcString = mimaEditText.getText().toString();
FileOutputStream fos;

try {

fos = new FileOutputStream(writeFile);
fos.write(abcString.getBytes());
fos.flush();
fos.close();

} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Intent intent = new Intent();
intent.setClass(KkkActivity.this, MainActivity.class);
startActivity(intent);

}
});

}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.kkk, menu);
return true;
}

}
四、
package com.example.zhuanhuan;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class AaaActivity extends Activity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.aaa);

Button jianceButton = (Button) findViewById(R.id.button1);
jianceButton.setOnClickListener(new OnClickListener() {

@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
Intent intent = new Intent();
intent.setClass(AaaActivity.this, QqqActivity.class);
startActivity(intent);
}
});

}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.aaa, menu);
return true;
}

}

Ⅷ 求大神寫一下jsp的簡單的注冊界面代碼。

1.需要一個jsp頁面:
//login.jsp核心代碼:
<form action="${pageContext.request.contextPath}/servlet/UserServlet" method="post">
<input type="text" name="loginname" /><input type="password" name="password"/>
<input type="submit" value="登錄"/>
</form>
2.需要一個servlet來驗證登錄信息
//UserServlet 核心代碼
class UserServlet extends HttpServlet{
protected void doGet(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {
process(request, response);
}
protected void doPost(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {
process(request, response);
}
private void process(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {
PrintWriter pw = response.getWriter();
request.setCharacterEncoding("UTF-8");
response.setContentType("text/html");
String loginname = request.getParameter("loginname");
String password = request.getParameter("password");
//創建一個service來處理業務邏輯(包括查詢資料庫操作)
UserService service = new UserService();
boolean bool = service.validateUser(loginname,password);
if(!bool){
pw.println("用戶名或密碼錯誤");
}else{
pw.println("登錄成功");
}
}
3.需要一個service處理業務邏輯(包括查詢資料庫操作)
//UserService 核心代碼
public class UserService{
/**
*查詢資料庫驗證用戶是否存在,返回boolean
*/
public boolean validateUser(String loginname,String password){
boolean bool = false;
Connection conn = null;
PreparedStatement ps = null;
//這里以mysql為例
try {
Class.forName("com.mysql.jdbc.Driver").newInstance();
conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/test", "root", "");
String sql = "select login_name,pass_word from t_user where login_name=? and pass_word=?";
ps = conn.prepareStatement(sql);
ps.setString(0, loginname);
ps.setString(1, password);
ResultSet rs = ps.executeQuery();
if(rs.next()){
bool = true;
}
} catch (Exception e) {
e.printStackTrace();
} finally{
try {
if(conn != null){
conn.close();
conn = null;
}
if(ps != null){
ps.close();
ps = null;
}
} catch (SQLException e) {
e.printStackTrace();
}
}
return bool;
}
}

Ⅸ 高分請教:HTML用戶注冊頁面代碼,用MYSQL資料庫

function CkUser(){
$.ajax({
type: "POST",
url: "__URL__/ajax",
data: "act=CkUser&username="+$('#username').val()+"&userid="+$('#userid').val(),
success: function(msg){
if(msg>0){
alert("用戶名已存在!");
$('#username').val('');
}
}
});
}

<input name="username" type="text" class="input" id="username" size="20" value="{$rs.username}" onblur="CkUser()" />

<php>
$act = trim($_POST["act"]);
switch($act)
{
case "CkUser":
$username = trim($_POST["username"]);
$userid = intval($_POST["userid"]);
$db = M("userinfo");
$num = $db->where("username='$username' and userid!=$userid and isdel=0")->count();
echo $num;
break;
}

熱點內容
iqoo安卓11變聲器在哪裡 發布:2024-12-22 15:46:45 瀏覽:251
ie鎖定初始密碼在哪裡找 發布:2024-12-22 15:44:48 瀏覽:295
linuxtcp窗口 發布:2024-12-22 15:34:24 瀏覽:947
安卓官翻機和原裝有什麼區別 發布:2024-12-22 15:34:24 瀏覽:661
linux掛載的磁碟 發布:2024-12-22 15:34:23 瀏覽:233
密碼不允許含有字元是什麼意思 發布:2024-12-22 15:30:15 瀏覽:168
圖片壓縮求 發布:2024-12-22 15:05:28 瀏覽:780
我的世界tis伺服器怎麼加 發布:2024-12-22 14:48:09 瀏覽:579
方舟伺服器虛擬內存是什麼意思 發布:2024-12-22 14:21:52 瀏覽:956
磁力片編程課 發布:2024-12-22 14:10:57 瀏覽:272