当前位置:首页 > 代码 > 正文

注册界面简单代码下载(注册界面简单代码下载安装)

admin 发布:2022-12-19 19:51 119


今天给各位分享注册界面简单代码下载的知识,其中也会对注册界面简单代码下载安装进行解释,如果能碰巧解决你现在面临的问题,别忘了关注本站,现在开始吧!

本文目录一览:

asp程序实现简单的注册,登录网页的源代码

1,(index.asp 用户登陆页面)

!-- #include file="conn.asp" --

!-- blog.soowooo.cn 悠悠长假期 --

html

head

meta http-equiv="Content-Type" content="text/html; charset=gb2312"

title会员/title

style type="text/css"

!--

body,td,th {

font-family: 宋体;

font-size: 14px;

}

--

/style

/head

body

center

p会员注册系统/p

form name="form1" method="post" action="login.asp"

table width="34%" border="0"

tr

td width="33%" height="30"用户名:/td

td width="67%" height="30"input name="username" type="text" id="username" size="15"/td

/tr

tr

td height="30"密 码:/td

td height="30"input name="password" type="password" id="password" size="15"/td

/tr

tr

td colspan="2" align="center"input type="submit" name="Submit" value="确定"

input type="reset" name="Submit" value="重置"/td

/tr

tr

td colspan="2"a href="reg.asp" target="_self"注册/a/td

/tr

/table

/form

/center

/body

/html

2,(login.asp 用户数据处理文件)

!-- #include file="conn.asp" --

%

'打开数据库判断用户是否存在,info为表名,username为字段名

set rsc=server.createobject("adodb.recordset")

sqlc="select * from info where username='"request.Form("username")"' and password='"request.Form("password")"'"

rsc.open sqlc,conn,1,1

session("username")=rsc("username")

session("password")=rsc("password")

session.Timeout=30

set rsc=nothing

response.Redirect("change.asp")

'如果用户不存在,session("username")为空

%

3,(change.asp 用户信息修改页面)

!-- #include file="conn.asp" --

html

head

meta http-equiv="Content-Type" content="text/html; charset=gb2312"

title修改/title

style type="text/css"

!--

body,td,th {

font-size: 14px;

}

--

/style/head

center

body

br

%

set rsc=server.createobject("adodb.recordset")

sqlc="select * from info where username='"session("username")"' and password='"session("password")"'"

rsc.open sqlc,conn,1,1

nr=rsc("password")

username=rsc("username")

password=rsc("password")

sex=rsc("sex")

qq=rsc("qq")

mail=rsc("mail")

add=rsc("add")

personalinfo=rsc("personalinfo")

vv=rsc("ntime")

set rsc=nothing

if nr="" then

response.Redirect("index.asp")

end if

if strcomp(nr,request.Form("password"))=0 then

response.Write("欢迎你!"request.Form("username"))

response.Write("你是在"vv"注册的")

session("username")=request.Form("username")

end if

if session("username")="" then

response.Redirect("index.asp")

end if

%

form name="form1" method="post" action="change.asp?ac=ch"

table width="39%" height="105" border="0"

tr

td width="27%" height="30"用户名:/td

td width="73%" height="30"input name="username" type="text" id="username" value="%=username%"

*/td

/tr

tr

td height="30"密 码:/td

td height="30"input name="password" type="text" id="password" value="%=password%"

*/td

/tr

tr

td height="30"性 别:/td

td height="30"input name="sex" type="text" id="sex" value="%=sex%"/td

/tr

tr

td height="30"QQ:/td

td height="30"input name="qq" type="text" id="qq" value="%=qq%"/td

/tr

tr

td height="30"Mail:/td

td height="30"input name="mail" type="text" id="mail" value="%=mail%"/td

/tr

tr

td height="30"地 址:/td

td height="30"input name="add" type="text" id="add" value="%=add%"/td

/tr

tr

td介绍/td

tdtextarea name="personalinfo" cols="30" rows="6" id="personalinfo"%=personalinfo%/textarea/td

/tr

tr

td /td

tdinput type="submit" name="Submit" value="修改"

a href="change.asp?se=y" target="_self"退出系统/a/td

% if strcomp(request.QueryString("se"),"y")=0 then

session("username")=""

response.Redirect("index.asp")

end if

%

/tr

/table

/form

%

if strcomp(request.QueryString("ac"),"ch")=0 then

set rs=server.createobject("adodb.recordset")

sql="select * from info where username='"session("username")"'"

rs.open sql,conn,1,3

rs("username")=request.Form("username")

rs("password")=request.Form("password")

rs("mail")=request.Form("mail")

rs("sex")=request.Form("sex")

rs("qq")=request.Form("qq")

rs("add")=request.Form("add")

rs("personalinfo")=request.Form("personalinfo")

rs.update

set rs=nothing

response.Write("修改完成!")

end if

%

/body

/center

/html

4,(reg.asp 新用户注册页面)

html

head

meta http-equiv="Content-Type" content="text/html; charset=gb2312"

title用户注册/title

style type="text/css"

!--

body,td,th {

font-family: 宋体;

font-size: 14px;

}

--

/style

/head

body

center

用户注册br

%

=request.QueryString("msg")

%

form name="form1" method="post" action="addnewdata.asp?ac=adduser"

table width="39%" height="105" border="0"

tr

td width="27%" height="30"用户名:/td

td width="73%" height="30"input name="username" type="text" id="username"

*/td

/tr

tr

td height="30"密码:/td

td height="30"input name="password" type="password" id="password"

*/td

/tr

tr

td height="30"确定密码:/td

td height="30"input name="password2" type="password" id="password2"

*/td

/tr

tr

td height="30"性别:/td

td height="30"input name="sex" type="text" id="sex"/td

/tr

tr

td height="30"QQ:/td

td height="30"input name="qq" type="text" id="qq"/td

/tr

tr

td height="30"Mail:/td

td height="30"input name="mail" type="text" id="mail"/td

/tr

tr

td height="30"地址:/td

td height="30"input name="add" type="text" id="add"/td

/tr

tr

td个人介绍/td

tdtextarea name="personalinfo" cols="30" rows="6" id="personalinfo"/textarea/td

/tr

tr

td /td

tdinput type="submit" name="Submit" value="提交"/td

/tr

/table

/form

/center

/body

/html

5,(addnewdata.asp 新用户注册数据处理文件)

!-- #include file="conn.asp" --

html

head

meta http-equiv="Content-Type" content="text/html; charset=gb2312"

title成功/title

/head

body

%

ac=request.QueryString("ac")

msg="注册错误信息"

if request.Form("username")="" then

msg=msg"br""用户名不能为空"

end if

if strcomp(cstr(request.Form("password")),cstr(request.Form("password2")))0 then

msg=msg"br""两次密码输入不同"

end if

if len(request.Form("password"))6 then

msg=msg"br""密码太简单"

end if

if strcomp(msg,"注册错误信息")0 then

response.Redirect("reg.asp?msg="msg)

end if

if ac="adduser" then

set rsc=server.createobject("adodb.recordset")

sql="select * from info where username='"request.Form("username")"'"

rsc.open sql,conn,1,1

ck=rsc("username")

set rsc=nothing

if ck"" then

msg=msg"br""用户名被人注册"

response.Redirect("reg.asp?msg="msg)

end if

dsql="select * from info where id is null"

set rs=server.createobject("adodb.recordset")

rs.open dsql,conn,1,3

rs.addnew

rs("username")=request.Form("username")

rs("password")=request.Form("password")

rs("mail")=request.Form("mail")

rs("sex")=request.Form("sex")

rs("qq")=request.Form("qq")

rs("add")=request.Form("add")

rs("personalinfo")=request.Form("personalinfo")

rs("ntime")=now

rs.update

set rs=nothing

%

center

a href="index.asp" target="_self"注册成功,点击登陆/a

/center

%

end if

%

/body

/html

6,(conn.asp 数据库连接文件)

%

'连接数据库开始

dim conn,rs,sql

on error resume next

dbpath=server.mappath("userinfo.mdb")

set conn=server.createobject("adodb.connection")

conn.open "PROVIDER=Microsoft.jet.OLEDB.4.0;data source="

'创建记录对象

set rs=server.createobject("adodb.recordset")

%

7,(userinfo.mdb ACCESS 数据库)

在ACCESS中建一个表,然后在这个表中建立字段名称

表名:info

字段名称 数据类型

id 自动编号

username 文本

password 文本

sex 文本

quest 文本

qq 文本

mail 文本

personalinfo 文本

ntime 文本

用JAVA编写一个用户或注册登录界面。请哪位高手能够写下具体的代码,谢谢

效果图

代码

!DOCTYPE html

html

head

meta charset="UTF-8"

title先锋图书馆管理系统-登录/title

style

*{

margin: 0;

padding: 0;

list-style: none;

}

#top{

width: 1000px;

height: 95px;

margin: 0 auto;

margin-top: 25px;

}

#top_top{

width: 1000px;

height: 65px;

background: deepskyblue;

}

#top_top_left{

width: 300px;

height: 65px;

float: left;

}

#top_top_leftlabel{

width: 200px;

height: 65px;

color: white;

float: right;

}

#top_top_left#a2{

padding-left: 10px;

padding-top: 20px;

font-size: 16px;

}

#top_bottom{

width: 1000px;

height: 30px;

}

#top_bottom_left{

width: 340px;

height: 30px;

line-height: 30px;

font-size: 12px;

background: skyblue;

color: white;

text-indent: 2em;

float: left;

}

#top_bottom_right{

width: 660px;

height: 30px;

line-height: 30px;

font-size: 12px;

color: blueviolet;

text-align: center;

float: right;

background: lightskyblue;

}

#content{

width: 1000px;

height: 600px;

margin: 0 auto;

background:#587FBA;

}

#content#text{

width: 1000px;

height: 50px;

line-height: 50px;

padding-top: 100px;

font-size: 36px;

font-family:"楷体";

font-weight: bold;

text-align: center;

}

#content#login{

width: 480px;

height: 210px;

margin-top: 20px;

margin-left: 260px;

background: #85A0CB;

}

#content#loginimg{

float: left;

}

#content#login#select{

width: 305px;

height: 210px;

float: right;

}

#content#login#selectdiv{

width: 230;

height: 30px;

margin-left: 30px;

}

#content#login#select#d1{

margin-top:30px;

margin-bottom: 3px;

}

#content#login#selectp{

font-size: 14px;

margin-left: 95px;

}

#bottom{

width: 1000px;

height: 35px;

line-height: 35px;

margin: 0 auto;

background: deepskyblue;

text-align: center;

color: white;

}

/style

/head

body

div id="top"

div id="top_top"

div id="top_top_left"

img src="img/test/a13.png" width="78px" height="65px"label id="a2"先锋图书馆系统管理平台/label

/div

/div

div id="top_bottom"

div id="top_bottom_left"当前位置 : 首页  系统管理  登录/div

div id="top_bottom_right"当前时间 : label id="lable"/label/div

/div

/div

div id="content"

div id="text"欢迎登录先锋图书馆管理系统/div

div id="login"

img src="img/test/a14.png"  width="175px" height="210px"/

form id="select"

div id="d1"用户名: nbsp;nbsp;input type="text" //div

div密    nbsp; 码: nbsp;nbsp;input type="password" //div

p

input type="radio" name="user" value="read"/读者nbsp;nbsp;nbsp;nbsp;

input type="radio" name="user" value="admin"/管理员

/pbr/

p

input type="button" value="确定" style="width: 50px;" onclick="put()"/nbsp;nbsp;nbsp;nbsp;

input type="reset" value="重置" style="width: 50px;"/

/p

/form

/div

/div

div id="bottom"欣欣科技有限公司版权所有/div

/body

script type="text/javascript" src="JQuery/jquery.js"/script

script type="text/javascript" src="js/GetCurrentTime.js"/script

script

     //验证用户名和密码

     function put(){

     var d = $("#selectdivinput");//获取用户名和密码

     var name = d[0].value;

     var pass = d[1].value;

     var user = null;

     var r = document.getElementsByName("user");//获取用户类型

     for(i=0;ir.length;i++){

     if(r[i].checked){

     user=r[i].value;

     }

     }

     //console.log(name + "," +pass + "," +user);//输出测试

     if(user==null){

     window.alert("请选择用户类型!");

     }else if(user=="admin"  name!="admin"){

     window.alter("用户名错误!");

     }else if(user=="admin"  name=="admin"  pass!="123456"){

     window.alert("密码错误!");

     }else if(name=="admin"  pass=="123456"  user=="admin"){

     window.location.href="work_02_welcome.html";//在js中在本页面中打开新链接

     }else{

     window.alert("用户名错误");

     }

     }

/script

/html

求大神写一下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;

}

}

求一个简单会员注册系统代码, 包括access文件。

简单会员注册系统,实际上是VB编程最起码的一个要求,它不是十分复杂,是一个简单的数据库操作实例。

必须知道:

1、如何连接数据库

2、如何连接数据表

3、如何在数据表添加新记录

一、连接Access中的A.mdb数据库:

Dim dbP As String

dbP = App.Path "\A.mdb"

GSL = "ms access;pwd=abcd" '数据库A.mdb设置了abcd的密码保护

Set WorkDefault = DBEngine.Workspaces(0)

Set db = DBEngine.Workspaces(0).OpenDatabase(dbP, False, False, GSL)

二、连接A.mdb数据库中的“会员注册”数据表:

strSQL = "SELECT * FROM 会员注册" '数据表连接字符串

Set RS = db.OpenRecordset(strSQL) '连接数据表

三、在“会员注册”数据表中添加新记录,即会员注册:

RS.AddNew '添加一条新记录

’这里填写更新内容

' 例如:RS("会员名称")=Text1.Text

'Text1.Text 是注册界面会员名称的输入文本框内容

'RS("登录密码")=Text2.Text

'Text2.Text 是注册界面会员密码的输入文本框内容

RS.UpDate '更新数据表数据

四、千万别忘了关闭数据表记录集对象:

RS.Close

Set RS=NotHing

用Dreamweaver做登陆和注册界面的代码?

1、插入一个div,设置为400x300px大小,背景色为米黄色,居中。

2、输入标题文字和用户名、密码,调整位置。

3、继续插入填写部分,插入--表单--文本域,所以需要输入内容的“框”都是文本域。设置用户名文本域ID为username,点击确定。

4、继续同样的方式插入密码的文本域,设置ID为password。因为密码是非明文的,不需要显示,所以我们在属性面板里选择文本域的类型--密码。

5、插入按钮。插入--表单--按钮,插入两个按钮,ID分别设置为login和reg。login按钮设置为登陆,reg按钮设置为注册。

6、初始值是我们未输入内容时,填写框显示的提示文字。

7、这样一个简单的登陆界面就做好了,是不是很简单呢。

注册界面简单代码下载的介绍就聊到这里吧,感谢你花时间阅读本站内容,更多关于注册界面简单代码下载安装、注册界面简单代码下载的信息别忘了在本站进行查找喔。

版权说明:如非注明,本站文章均为 AH站长 原创,转载请注明出处和附带本文链接;

本文地址:http://ahzz.com.cn/post/21503.html


取消回复欢迎 发表评论:

分享到

温馨提示

下载成功了么?或者链接失效了?

联系我们反馈

立即下载