HOME
BBS
欢迎您,您可以注册或者登录 密码找回
qq登录 微博登录正在制作中……
我的个人网站 » Log » 日常编码常识
阅:40 | 回:14

日常编码常识

鱼鱼 发表于 2024-12-23 9:27:29
  •  
职务:管理员
积分:19315
发:13 / 516 登:3370
等级:鱻
最后登录:2025-09-13


-------------下面的信息尚未审核,普通会员以及游客无权查看该信息-------------

以萌养阵,方可长命百岁。
鱼鱼 发表于 2024-12-23 9:28:20
  •  
  • 回复1楼
职务:管理员
积分:19315
发:13 / 516 登:3370
等级:鱻
最后登录:2025-09-13
背景图设置及跳转

<script type="text/javascript">

if(window.screen.width==0){window.location.replace("http://my.cy0575.cn/")};

var system={win:false,mac:false,xll:false};

var p = navigator.platform;

system.win=p.indexOf("Win")==0;

system.mac=p.indexOf("Mac")==0;

system.x11=(p=="X11") || (p.indexOf("Linux")==0);

if(system.win||system.mac||system.xll) {

location.replace("https://cy0575.cn/0tg");

}

</script>

<div><p align="center">

<img src="20241111.png" width="980" vspace="0" hspace="0" border="0" height="150"></a> </div>

背景

<style>

body{ background-color:#2F2F2F}

#stage{ margin-left: auto; margin-right: auto; display: block; margin-top: 50px; }

</style>

以萌养阵,方可长命百岁。
鱼鱼 发表于 2024-12-23 9:29:48
  •  
  • 回复2楼
职务:管理员
积分:19315
发:13 / 516 登:3370
等级:鱻
最后登录:2025-09-13
单密码加密访问教程

<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-12-23 9:30:38
  •  
  • 回复3楼
职务:管理员
积分:19315
发:13 / 516 登:3370
等级:鱻
最后登录:2025-09-13
1、

<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('你好密码错误!请重新输入,联系微信QQ:80561642:');

}

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

history.go(-1);

return " ";

}

document.write(password());

</SCRIPT>

```

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

挺不错的分享给大家。

3、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-12-23 9:31:15
  •  
  • 回复4楼
职务:管理员
积分:19315
发:13 / 516 登:3370
等级:鱻
最后登录:2025-09-13
<head><script type="text/javascript">

    document.oncontextmenu = function() { return false; }; // 禁用右键菜单

</script></head>

以萌养阵,方可长命百岁。
鱼鱼 发表于 2024-12-23 9:33:16
  •  
  • 回复5楼
职务:管理员
积分:19315
发:13 / 516 登:3370
等级:鱻
最后登录:2025-09-13
手机电脑平板分类跳转

<%@ LANGUAGE="VBScript" %>

<%

Function IsMobileDevice()

    Dim userAgent

    Dim mobileKeywords

    Dim i

    userAgent = Request.ServerVariables("HTTP_USER_AGENT")

    mobileKeywords = Array("Android", "webOS", "iPhone", "iPad", "iPod", "BlackBerry", "Windows Phone", "Opera Mini", "IEMobile")

    For i = 0 To UBound(mobileKeywords)

        If InStr(userAgent, mobileKeywords(i)) > 0 Then

            IsMobileDevice = True

            Exit Function

        End If

    Next

    IsMobileDevice = False

End Function

' 调用IsMobileDevice函数来检测设备类型

If IsMobileDevice() Then

    ' 如果是移动设备,重定向到移动版页面

    Response.Redirect "index_mobile.asp"

Else

    ' 如果是桌面设备,继续显示当前页面或重定向到桌面版页面

    ' 如果不需要重定向,可以省略这行代码

    Response.Redirect "index_pc.asp"

End If

%>

以萌养阵,方可长命百岁。
鱼鱼 发表于 2024-12-23 9:33:55
  •  
  • 回复6楼
职务:管理员
积分:19315
发:13 / 516 登:3370
等级:鱻
最后登录:2025-09-13
手机本访问-PC跳转或不能访问

<script type="text/javascript">

if(window.screen.width==0){window.location.replace("https://my.cy0575.cn/")};

var system={win:false,mac:false,xll:false};

var p = navigator.platform;

system.win=p.indexOf("Win")==0;

system.mac=p.indexOf("Mac")==0;

system.x11=(p=="X11") || (p.indexOf("Linux")==0);

if(system.win||system.mac||system.xll) {

location.replace("https://cy0575.cn/0tg");

}

</script>

以萌养阵,方可长命百岁。
鱼鱼 发表于 2024-12-23 9:34:33
  •  
  • 回复7楼
职务:管理员
积分:19315
发:13 / 516 登:3370
等级:鱻
最后登录:2025-09-13
手机版直接跳转
<script type="text/javascript">

    var mobileUrl="https://cy0575.cn/wap",

        mobile = (/mmp|symbian|smartphone|midp|wap|phone|xoom|iphone|ipad|ipod|android|blackberry|mini|windows\sce|palm/i.test(navigator.userAgent.toLowerCase()));

    if (mobile) {

        window.location = mobileUrl;

    }

</script>

以萌养阵,方可长命百岁。
鱼鱼 发表于 2024-12-23 9:35:12
  •  
  • 回复8楼
职务:管理员
积分:19315
发:13 / 516 登:3370
等级:鱻
最后登录:2025-09-13
电脑版跳转:

<META HTTP-EQUIV="REFRESH" CONTENT="20;URL=http://cy0575.cn/3">

以萌养阵,方可长命百岁。
鱼鱼 发表于 2024-12-23 9:36:21
  •  
  • 回复9楼
职务:管理员
积分:19315
发:13 / 516 登:3370
等级:鱻
最后登录:2025-09-13
无浏览器网页跳转

<div title="MySSL 安全签章" id="myssl_seal"

onclick="window.open('https://myssl.com/seal/detail?domain=ymhost.cn','MySSL安全签章','

height=800,width=470,top=0,right=0,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,status=no')" style="text-align: center">

<img src="/images/seal.png" alt="MySSL 安全签章"style="width: 100px; height: auto; cursor: pointer"></div>

以萌养阵,方可长命百岁。
鱼鱼 发表于 2024-12-23 9:51:04
  •  
  • 回复12楼
职务:管理员
积分:19315
发:13 / 516 登:3370
等级:鱻
最后登录:2025-09-13
文字 图片居中显示源代码
<p style="text-align: center"> 图片地址或图片超链接
以萌养阵,方可长命百岁。
鱼鱼 发表于 2024-12-23 9:51:35
  •  
  • 回复13楼
职务:管理员
积分:19315
发:13 / 516 登:3370
等级:鱻
最后登录:2025-09-13
图片超链接源代码限定图片长宽额度<a href="http://bbs.cy0575.cn/forum.php?mod=viewthread&tid=2021" target="_blank">
<img src="http://cy0575.cn/ad011.GIF" width="600" height="300" border="0"></a>
以萌养阵,方可长命百岁。
鱼鱼 发表于 2024-12-23 9:52:10
  •  
  • 回复14楼
职务:管理员
积分:19315
发:13 / 516 登:3370
等级:鱻
最后登录:2025-09-13
文字新窗口打开超链接源代码

<p><p style="text-align: center">

<a href="http://cy0575.cn" target="_blank">返回首页</a> |

<a href="http://bbs.cy0575.cn" target="_blank">源码论坛</a> |

<a href="https://jinyufish.taobao.com/" target="_blank">淘宝店1</a> |

<a href="https://weidian.com/?userid=771195562" target="_blank">微店1</a></p>

以萌养阵,方可长命百岁。
鱼鱼 发表于 2024-12-23 9:53:44
  •  
  • 回复15楼
职务:管理员
积分:19315
发:13 / 516 登:3370
等级:鱻
最后登录:2025-09-13
禁用网站右键菜单操作源码,将以下源码放置于首页的最前面即可。

<head><script type="text/javascript">

    document.oncontextmenu = function() { return false; }; // 禁用右键菜单

</script></head>

以萌养阵,方可长命百岁。
鱼鱼 发表于 2024-12-23 9:54:29
  •  
  • 回复16楼
职务:管理员
积分:19315
发:13 / 516 登:3370
等级:鱻
最后登录:2025-09-13
网页外新窗口打开新网址链接程序码<a href="/" target='_blank'>XXXXXXXXXXXXX</a>
以萌养阵,方可长命百岁。


 14/ 1 1
目前不允许游客回复,请 登录 注册 发表言论。