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

好看的注册界面代码(好看的登录注册界面)

admin 发布:2022-12-19 05:20 118


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

本文目录一览:

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

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

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

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

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

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

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

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

注册/登陆页面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();"

trtd 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 userNL0 Or userNL200 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代码可相信楼主参照会员注册代码应该没问题了====

如何用Java编写用户注册界面?

界面建议用可视化来做,美观且便捷。下面这个是完全用代码写的,仅供参考。

import javax.swing.*;

import java.awt.event.*;

import java.awt.*;

import java.sql.*;

public class Register extends JFrame {

JLabel jl1 = new JLabel("用户名");

JTextField jt1 = new JTextField();

JLabel jl2 = new JLabel("邮箱");

JTextField jt2 = new JTextField();

JLabel jl3 = new JLabel("密码");

JPasswordField jpw1 = new JPasswordField();

JLabel jl4 = new JLabel("密码确认");

JPasswordField jpw2 = new JPasswordField();

JButton register = new JButton("注册");

JButton clean = new JButton("清空");

public Register(){

setLayout(new GridLayout(5,2));

add(jl1);

add(jt1);

add(jl2);

add(jt2);

add(jl3);

add(jpw1);

add(jl4);

add(jpw2);

add(register);

add(clean);

String name = jt1.getText();

String email = jt2.getText();

String pw = jpw1.getText();

register.addActionListener(new ActionListener(){

public void actionPerformed(ActionEvent e){

try{

Class.forName("com.mysql.jdbc.Driver");

Connection con = DriverManager.getConnection("jdbc:mysql://localhost/db","root","");

Statement sta = con.createStatement();

sta.executeUpdate("INSERT INTO register VALUES(name,email,pw)");

JOptionPane.showMessageDialog(null,"注册成功","提示",JOptionPane.INFORMATION_MESSAGE);

}

catch(Exception ex){

ex.getStackTrace();

}

}

});

clean.addActionListener(new ActionListener(){

public void actionPerformed(ActionEvent e){

jt1.setText("");

jt2.setText("");

jpw1.setText("");

jpw2.setText("");

}

});

}

public static void main(String[] args){

Register frame = new Register();

frame.setTitle("用户注册");

frame.setLocationRelativeTo(null);

frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

frame.setSize(400,400);

frame.setVisible(true);

}

}

求一用php写的注册和登录页面代码

reg.php文件

?php

header("Content-type:text/html;charset=utf-8");

if($_POST){

$dsn = 'mysql:dbname=1104javab;host=127.0.0.1';

$user = 'root';

$password = '';

try{

$pdo = new pdo($dsn,$user,$password,array(PDO::MYSQL_ATTR_INIT_COMMAND = 'SET NAMES \'UTF8\'')

);

}catch(Exception $e){

echo '错误'.$e-getmessage();

}

$name = $_POST['name'];

$pwd = md5($_POST['pwd']);

$sql = "insert into 表 (username,password) values ('$name','$pwd')";

$exec = $pdo-query($sql);

if($exec){

echo "scriptalert('成功');location.href='reg.html'/script";

}else{

echo "scriptalert('失败');location.href='reg.html'/script";

}

}

?

reg.html文件

form action='reg.php' method='post'

用户名:input type='text' name='name'

密码:input type='password' name='pwd'

input type='submit' value='submit'

/form

login.html文件

form action='reg.php' method='post'

用户名:input type='text' name='name'

密码:input type='password' name='pwd'

input type='submit' value='submit'

/form

login.php文件

header("Content-type:text/html;charset=utf-8");

if($_POST){

$dsn = 'mysql:dbname=1104javab;host=127.0.0.1';

$user = 'root';

$password = '';

try{

$pdo = new pdo($dsn,$user,$password,array(PDO::MYSQL_ATTR_INIT_COMMAND = 'SET NAMES \'UTF8\'')

);

}catch(Exception $e){

echo '错误'.$e-getmessage();

}

$name = $_POST['name'];

$pwd = $_POST['pwd'];

$sql = "select user_id from 表名 where username='$name' and password='$pwd'";

$stmt = $pdo-query($sql);

$info = $stmt-fetch(PDO::FETCH_ASSOC);

if($info){

echo "登录成功";

}else{

echo "登录失败";

}

}

大概这样

用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

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

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

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


取消回复欢迎 发表评论:

分享到

温馨提示

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

联系我们反馈

立即下载