1.2、登陆登录javascript+CSS+Html实现用户注册及登录的注册注册格式验证。在用户登录功能中试加入验证码功能
2.Html制作简单而漂亮的源码源码登录页面
3.HTML试题:操作题:编写一个用户登录的界面,要求排版争取。登陆登录论坛程序源码
2、注册注册javascript+CSS+Html实现用户注册及登录的源码源码本地生活app源码格式验证。在用户登录功能中试加入验证码功能
下面是登陆登录关键代码,如果剩下的注册注册你都搞不懂,我就无语了
JS
<script type="text/javascript" language="javascript">
function reloadcodeOne(){ //刷新验证码函数
var verify = document.getElementById('checkCodeImg');
verify.setAttribute('src',源码源码 'validateCode?dt=' + Math.random());
}
<script type="text/javascript" >
html
<p>
<label>验证码:</label>
<input class="code" value="请输入验证码" title="请输入验证码" name="rendCode" id="rendCode" onfocus="if (value =='请输入验证码'){ value =''}" onblur="if (value ==''){ value='请输入验证码'}" type="text" size="6" />
<span><img id="checkCodeImg" src="validateCodeServlet" onclick="javascript:reloadcodeOne();" alt="" width="" height="" /></span>
</p>
java代码
package com.zhihui.action.common;
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import java.util.Random;
import javax.imageio.ImageIO;
import javax.servlet.ServletException;
import javax.servlet.ServletOutputStream;
import javax.servlet..zhihui.action.base.BaseAction;
/
*** <p>
* 校验码控制器
* </p>
*
* @author liurong
* @version ValidateCodeServlet.java,v 0.1 -- 上午:: Administrator
* Exp
*/
public class ValidateCodeAction extends BaseAction {
private static final long serialVersionUID = 1L;
// 验证码的宽度。
private int width = ;
// 验证码的登陆登录高度。
private int height = 5;
// 验证码字符个数
private int codeCount = 5;
private int x = 0;
// 字体高度
private int fontHeight;
private int codeY;
/*char[] codeSequence = { 'A',注册注册 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'J',
'K', 'L', 'M', 'N', 'P', 'R', 'S', 'T', 'U', 'V', 'W',
'X', 'Y', 'Z', '2', '3', '4', '5', '6', '7', '8', '9' };*/
char[] codeSequence = { '1', '2', '3', '4', '5', '6', '7', '8', '9', '0' };
HttpServletRequest req=ServletActionContext.getRequest();
HttpServletResponse resp=ServletActionContext.getResponse();
public String execute()
throws ServletException, java.io.IOException {
// 宽度
String strWidth = "";
// 高度
String strHeight = "";
// 字符个数
String strCodeCount = "5";
width = Integer.parseInt(strWidth);
height = Integer.parseInt(strHeight);
codeCount = Integer.parseInt(strCodeCount);
x = width / (codeCount);
fontHeight = height - 4;
codeY = height - 4;
// 定义图像buffer
BufferedImage buffImg = new BufferedImage(width, height,
BufferedImage.TYPE_INT_RGB);
Graphics2D g = buffImg.createGraphics();
Random random = new Random();
// 将图像填充为白色
g.setColor(Color.WHITE);
g.fillRect(0, 0, width, height);
Font font = new Font("Fixedsys", Font.PLAIN, fontHeight);
g.setFont(font);
g.setColor(Color.BLACK);
g.drawRect(0, 0, width - 1, height - 1);
g.setColor(Color.BLACK);
for (int i = 0; i < ; i++) {
int x = random.nextInt(width);
int y = random.nextInt(height);
int xl = random.nextInt(8);
int yl = random.nextInt(8);
g.drawLine(x, y, x + xl, y + yl);
}
// randomCode用于保存随机产生的验证码,以便用户登录后进行验证。源码源码
StringBuffer randomCode = new StringBuffer();
int red = 0,登陆登录指标源码怎么安装 green = 0, blue = 0;
for (int i = 0; i < codeCount; i++) {
String strRand = String.valueOf(codeSequence[random.nextInt(codeSequence.length)]);
red = 0;//random.nextInt();
green = 0;//random.nextInt();
blue = 0;//random.nextInt();
g.setColor(new Color(red, green, blue));
g.drawString(strRand, (i ) * x, codeY);
randomCode.append(strRand);
}
HttpSession session = req.getSession();
session.setAttribute("validateCode", randomCode.toString());
resp.setHeader("Pragma", "no-cache");
resp.setHeader("Cache-Control", "no-cache");
resp.setDateHeader("Expires", 0);
resp.setContentType("image/jpeg");
ServletOutputStream sos = resp.getOutputStream();
ImageIO.write(buffImg, "jpeg", sos);
sos.close();
return null;
}
public int getWidth() {
return width;
}
public void setWidth(int width) {
this.width = width;
}
public int getHeight() {
return height;
}
public void setHeight(int height) {
this.height = height;
}
public int getCodeCount() {
return codeCount;
}
public void setCodeCount(int codeCount) {
this.codeCount = codeCount;
}
public int getX() {
return x;
}
public void setX(int x) {
this.x = x;
}
public int getFontHeight() {
return fontHeight;
}
public void setFontHeight(int fontHeight) {
this.fontHeight = fontHeight;
}
public int getCodeY() {
return codeY;
}
public void setCodeY(int codeY) {
this.codeY = codeY;
}
public char[] getCodeSequence() {
return codeSequence;
}
public void setCodeSequence(char[] codeSequence) {
this.codeSequence = codeSequence;
}
public HttpServletRequest getReq() {
return req;
}
public void setReq(HttpServletRequest req) {
this.req = req;
}
public HttpServletResponse getResp() {
return resp;
}
public void setResp(HttpServletResponse resp) {
this.resp = resp;
}
}
Html制作简单而漂亮的登录页面
本文详细阐述了如何使用Html技术制作一个既简单又美观的登录页面,并提供了实用的注册注册代码示例。
首先,源码源码让我们先睹为快。如何分析网页源码
以下是Html源码和CSS代码,请复制到您的剪贴板。
总结:
具体代码如下所示:
placeholder="用户名"功能:作为占位符使用。土特产网站源码
以上便是本篇文章的全部内容,希望对您的学习之路有所帮助。
HTML试题:操作题:编写一个用户登录的界面,要求排版争取。
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4. Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>登录界面</title>
</head>
<body>
<form>
用户名:<input id="loginName" value="" type="text"><br>
密 码:<input id="password" value="" type="password"><br>
<input type="submit" id="btnlogin" value="登录"> <input type="reset" id="btnreset" value="取消">
</form>
</body>
</html>
大概就是这样了, 你说的要求排版争取什么意思不明白
2024-11-21 00:002091人浏览
2024-11-20 23:362308人浏览
2024-11-20 22:512552人浏览
2024-11-20 22:481385人浏览
2024-11-20 22:432905人浏览
2024-11-20 22:11177人浏览
1.Eclipse怎么导入jar格式的包2.如何从eclipse引入jar包到项目中?3.Eclipse如何导入jar包Eclipse怎么导入jar格式的包 1、首先确定电脑上已经安装了Eclip
1.怎样在F12下查看源码和调试网页CSS2.如何查看网页的源码3.如何修改网页源代码?4.如何修改网页源码?5.电脑如何查看网页的源码6.怎么修改网页源代码?怎样在F12下查看源码和调试网页CSS
1.字画竞拍画室竞拍系统源码开发及功能介绍2.广东省第三届强网杯Writeup3.广州越秀区做软件开发的公司有哪些?哪家比较有实力?4.棋牌游戏源码定制开发需要多少钱?5.广东互动直播系统多少钱6.广