源码论坛

 找回密码
 立即注册
香港免备空间主机促销中心特价微空间价格表香港标准空间价格表高防攻击空间价格表金牌高防空间价格表

加密访问教程源代码

[复制链接]
发表于 2024-7-8 12:30:04 | 显示全部楼层 |阅读模式
<SCRIPT language=JavaScript>

function password() {

var testV = 1;

var pass1 = prompt('请输入密码:','');

while (testV < 3) {

if (!pass1)

history.go(-1);

if (pass1 == "cy0575") {

alert('密码正确!');

break;

}

testV+=-1;

var pass1 = prompt('你好密码错误!请重新输入:');

}

if (pass1!="password" & testV ==3)

history.go(-1);

return " ";

}

document.write(password());

</SCRIPT>
```

只需要把此代码放入到〈/head〉标签前即可"/

挺不错的分享给大家。
 楼主| 发表于 2024-7-19 08:27:29 | 显示全部楼层
html网页密码访问



<html lang="en">
<head>
<meta charset="UTF-8">
<title>Password Access</title>
<script>
function checkPassword() {
    var password = document.getElementById('password').value;
    // 假设正确的密码是 "1234"
    if (password === "1234") {
        alert("正确的密码!");
        // 密码正确后的操作,比如跳转页面
        // window.location.href = 'your_secure_page.html';
    } else {
        alert("错误的密码!");
    }
}
</script>
</head>
<body>
<div>
    <input type="password" id="password" placeholder="请输入密码">
    <button onclick="checkPassword()">确认</button>
</div>
</body>
</html>
 楼主| 发表于 2024-7-19 08:27:42 | 显示全部楼层
html网页密码访问



<html lang="en">
<head>
<meta charset="UTF-8">
<title>Password Access</title>
<script>
function checkPassword() {
    var password = document.getElementById('password').value;
    // 假设正确的密码是 "1234"
    if (password === "1234") {
        alert("正确的密码!");
        // 密码正确后的操作,比如跳转页面
        // window.location.href = 'your_secure_page.html';
    } else {
        alert("错误的密码!");
    }
}
</script>
</head>
<body>
<div>
    <input type="password" id="password" placeholder="请输入密码">
    <button onclick="checkPassword()">确认</button>
</div>
</body>
</html>
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

ymhost

QQ|论坛首页|空间首页|手机版|源码论坛

全屏模式

GMT+8, 2024-9-20 05:58

Powered by cy0575.cn X3.5

快速回复 返回顶部 返回列表