javascript html 设计一个登录界面
注册页面代码:<!DOCTYPE html><html lang="en">
<head>
<meta charset="UTF-8">
<title>注册</title>
</head>
<body>
<form method="post" onsubmit="return false" id="form">
<input type="text" name="username" placeholder="用户名"><br>
<input type="password" name="password" placeholder="密码"><br>
<input type="password" name="rePassword" placeholder="再次输入密码"><br>
<input type="submit" onclick="register_user()" value="注册"><br>
</form>
<a href="login.html">去登录</a>
<script>
var localDB = openDatabase('localDB',界面界面simhash项目源码 '1.0', 'Test DB', 2 * * );
localDB.transaction(function (ts) {
ts.executeSql('CREATE TABLE IF NOT EXISTS user(username,password)')
});
function register_user() {
var username = document.getElementsByTagName("input")[0].value;
var password = document.getElementsByTagName("input")[1].value;
var rePassword = document.getElementsByTagName("input")[2].value;
if(password != rePassword)
{
alert("两次输入的密码不同,请重新输入");
}else
{
localDB.transaction(function(ts){
ts.executeSql("INSERT INTO user (username,源码源码用password) VALUES ('"+username+"','"+password+"');");
alert("注册成功");
});
}
}
</script>
</body>
</html>
登录页面代码:
<!DOCTYPE html><html lang="en">
<head>
<meta charset="UTF-8">
<title>登录</title>
</head>
<body>
<form onsubmit="return false" method="post">
<input type="text" placeholder="用户名"><br>
<input type="password" placeholder="密码"><br>
<input type="submit" value="登录" onclick="login()"><br>
</form>
<a href="register.html">去注册</a>
<script>
var localDB = openDatabase('localDB', '1.0', 'Test DB', 2 * * );
localDB.transaction(function (ts) {
ts.executeSql("SELECT * FROM user",[],function (tx, results) {
var len = results.rows.length;
if(len<=0)
{
localDB.transaction(function (ts) {
ts.executeSql('CREATE TABLE IF NOT EXISTS user(username,password)')
});
}
});
});
function login() {
var username = document.getElementsByTagName("input")[0].value;
var password = document.getElementsByTagName("input")[1].value;
localDB.transaction(function (ts) {
ts.executeSql("SELECT * FROM user WHERE username='"+username+"';",[],function (ts, res) {
if(res.rows.length<=0)
{
alert("登录失败,用户未注册");
}else if (password == res.rows[0].password)
{
alert("登录成功,手机手机源码安装opensim三秒后跳转到百度");
setInterval(function () {
location.href = "";
},);
}else
{
alert("登录失败,密码错误");
}
});
})
}
</script>
</body>
</html>
以上代码使用了WEB SQL,登录登录sysbench源码安装还请选择合适的界面界面浏览器查看。
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-30 09:13
2024-11-30 09:07
2024-11-30 08:52
2024-11-30 07:16
2024-11-30 07:02