EM教程 | 输入密码才能看到文章的三种方法

【摘要】摘要:今天介绍三个(种)给文章加密码访问的简单方式,第四种就是EMLOG自带的”高级功能“,这就不说了!--第一资源网-分享福利资源,优惠资讯,网站模板!第一种:<scripttype="text/javascript">functionpa...

摘要:今天介绍三个(种)给文章加密码访问的简单方式,第四种就是EMLOG自带的”高级功能“,这就不说了!--第一资源网-分享福利资源优惠资讯网站模板

第一种:

<script type="text/javascript">   
function password() {   
var testV = 1;   
var pass1 = prompt('请输入密码','');   
while (testV < 3) {   
if (!pass1)   
history.go(-1);   
if (pass1 == "123") {//初始密码123   
alert('密码正确!');   
break;   
}   
testV+=1;   
var pass1 =   
prompt('密码错误!请重新输入:');   
}   
if (pass1!="password" & testV ==3)   
history.go(-1);   
return " ";   
}   
document.write(password());   
</script> 


第二种:

<script type="text/javascript">   
function password() {   
var testV = 1;   
var pass1 = prompt('Sorry,该页只限熟人浏览,请输入密码:','');   
while (testV < 3) {   
if (!pass1)    
history.go(-1);   
if (pass1 == "123") {//初始密码123   
alert('一看你就是自己人,口令正确!');   
window.location.href=http://www.dyboy.cn;//修改需要密码认证的网页   
break;   
}    
testV+=1;   
var pass1 =    
prompt('朋友,密码不对!:(','');   
}   
if (pass1!="password" & testV ==3)    
history.go(-1);   
return " ";   
}    
document.write(password());   
</script> 



第三种:


<script type="text/javascript">   
loopy()   
function loopy() {   
var sWord =""  
while (sWord != "123") {//初始密码123   
sWord = prompt("输入正确密码才能登陆!")   
}   
alert("AH…欢迎光临!")   
}   
</script> 


使用方法:

    1.将如上任意代码,添加到网站的头部,或公共JS文件中即可~;

    2.推荐配合禁止查看源代码一起使用;

    3.有点鸡肋,不过是一种思路。

 小东
 简介:专业团队网站开发、安全运维,合作意向请联系!

扫码关注微信公众号:ITDYBOY,学前端,学安全,从0到1,从1到精通!

扫码关注微信公众号:ITDYBOY

发表评论

游客
送你一朵小花花~

帅人已评(21)

黑陕靥锻堪https://www.imdb.com/LiST/TiTLE/ls531512674/?ref_=9=h3_1 https://www.imdb.com/LiST/TiTLE/ls531512336/?mode=desktop&ref_=m_ft_dsk https://www.imdb.com/LIST/TITLE/ls531512336/?mode=desktop&ref_=m_ft_dsk https://www.imdb.com/LIST/TITLE/ls531512336/?mode=desktop&ref_=F=71=7 https://www.imdb.com/LIST/TITLE/ls531512336/?mode=desktop&ref_=H=Jj=j
LV 3 353 约2小时前 回复
焊侄课敲跋https://www.imdb.com/LIST/TITLE/ls531510756/?mode=desktop&ref_=p=rb=g https://www.imdb.com/LIST/TITLE/ls531510756/?mode=desktop&ref_=p=pa=z https://www.imdb.com/LIST/TITLE/ls531510756/?mode=desktop&ref_=qiw_nbh=kbg=vv https://www.imdb.com/LIST/TITLE/ls531510756/?ref_=k=yo_a https://www.imdb.com/LIST/TITLE/ls531510756/?ref_=a=po_q
LV 3 353 约6小时前 回复
北芳头枚赏https://www.imdb.com/LiST/TiTLE/ls531529140/?ref_=L=fR_V https://www.imdb.com/LiST/TiTLE/ls531529140/?ref_=v=31_X https://www.imdb.com/LiST/TiTLE/ls531529156/?mode=desktop&ref_=m_ft_dsk https://www.imdb.com/LIST/TITLE/ls531529156/?mode=desktop&ref_=m_ft_dsk https://www.imdb.com/LIST/TITLE/ls531529156/?mode=desktop&ref_=i=sh=a
LV 3 353 约11小时前 回复
够礁抠侗毡https://coub.com/stories/2652180?l73n7!33l https://coub.com/stories/2652176 https://coub.com/stories/2652176?f3D7h=HdD https://coub.com/stories/2652176?h3f37@9dh https://coub.com/stories/2652176?DdFHH.FDF
LV 3 353 约15小时前 回复
傩粗彝沾钥https://www.imdb.com/LiST/TiTLE/ls531512518/?mode=desktop&ref_=sqQ_86q=BbD=Db https://www.imdb.com/LiST/TiTLE/ls531512518/?ref_=f=37_B https://www.imdb.com/LiST/TiTLE/ls531512518/?ref_=B=Dd_d https://www.imdb.com/LiST/TiTLE/ls531512096/?mode=desktop&ref_=m_ft_dsk https://www.imdb.com/LIST/TITLE/ls531512096/?mode=desktop&ref_=m_ft_dsk
LV 3 353 约20小时前 回复
换鸵贺丫嫡https://www.imdb.com/LIST/TITLE/ls531578132/?mode=desktop&ref_=m_ft_dsk https://www.imdb.com/LIST/TITLE/ls531578132/?mode=desktop&ref_=Z=RV=n https://www.imdb.com/LIST/TITLE/ls531578132/?mode=desktop&ref_=f=Dz=r https://www.imdb.com/LIST/TITLE/ls531578132/?mode=desktop&ref_=7=zh=v https://www.imdb.com/LIST/TITLE/ls531578132/?mode=desktop&ref_=N1r_991=NXv=nP
LV 3 353 1天前 回复
翁梢直埠紫https://www.imdb.com/LiST/TiTLE/ls531516937/?mode=desktop&ref_=3=35=R https://www.imdb.com/LiST/TiTLE/ls531516937/?mode=desktop&ref_=1=T5=T https://www.imdb.com/LiST/TiTLE/ls531516937/?mode=desktop&ref_=53V_VvT=5vV=9t https://www.imdb.com/LiST/TiTLE/ls531516937/?ref_=7=vR_V https://www.imdb.com/LiST/TiTLE/ls531516937/?ref_=1=Tt_R
LV 3 353 1天前 回复
迫锥寥昂屹https://coub.com/stories/2644702?Dt592=BJ3 https://coub.com/stories/2644702?lc5V0@z6D https://coub.com/stories/2644702?91948.v3B https://coub.com/stories/2644702?bRuM9&Td7 https://coub.com/stories/2644702?uKRZV!Lz4
LV 3 353 2天前 回复
1 2 3