如何给PHP网页加密码访问?php页面加密访问源码
首页>>技术教程>>正文
本篇文章更新于 2022-01-08 22:36:12
本篇文章更新于 2022-01-08
如何给PHP网页加密码访问?php页面加密访问源码

教你如何加密一个php页面,给PHP页面加密码才能访问!引流必备!
将下面代码添加页头

<?php  
header('Content-type:text/html;charset=utf-8');
$password = "zygx"; // 这里是正确密码  
$p = "";  
if(isset($_COOKIE["isview"]) && $_COOKIE["isview"] == $password){  
$isview = true;  
}else{  
if(isset($_POST["pwd"])){  
if($_POST["pwd"] == $password){  
setcookie("isview",$_POST["pwd"],time()+3600*0.2);  
$isview = true;  
}else{  
$p = (empty($_POST["pwd"])) ? "需要密码才能查看,请输入密码。(扫码回复:2468)" : "密码不正确,请重新输入。(扫码回复:2468)";  
}  
}else{  
$isview = false;  
$p = "如果你对本页反感,请立即关闭!谢谢!</br>关注微信公众号:小辉网络(SSN5068)回复:2468 即可获取密码!";  
}  
}  
 
if($isview){ ?>  

将下面代码添加最后

<?php }else{ ?>  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns=" http://www.w3.org/1999/xhtml"> 
<head>  
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />  
<meta http-equiv="pragma" content="no-cache" />  
<meta http-equiv="cache-control" content="no-cache" />  
<meta http-equiv="expires" content="0" />  
<title>Q绑查询</title>
<meta name="keywords" content="PHP加密">
<meta name="description" content="PHP加密"> 
<!--[if lt IE 6]>  
<style type="text/css">  
.z3_ie_fix{  
float:left;  
}  
</style>  
<![endif]-->  
<style type="text/css">   
body{  
background:none;  
}  
.passport{  
border:1px solid red;  
background-color:#FFFFCC;  
width:400px;  
height:150px;  
position:absolute;  
left:49.9%;  
top:49.9%;  
margin-left:-200px;  
margin-top:-55px;  
font-size:14px;  
text-align:center;  
line-height:30px;  
color:#746A6A;  
}  
.post-content-post {
    border: 1px dashed #F60;
    padding: 10px;
    margin: 10px 0;
    line-height: 200%;
    color: #F00;
    background-color: #FFF4FF;
    overflow: hidden;
    clear: both;
}
</style> 
<div class="post-content-post">
<div class="huoduan_hide_box" style="border:10px dashed #F60; padding:10px; margin:10px 0; line-height:200%; color:#F00; background-color:#FFF4FF; overflow:hidden; clear:both;">
<p><img loading="lazy" data-original="https://cdn.jsdelivr.net/gh/993124/pay@master/img/ewm.jpg" width="300" height="300" class="alignnone size-medium img-lazyload" /></p>
输入查看密码<form action="" method="post" style="margin:0px;">  
<input type="password" name="pwd" style="border:none;float:left;width:100px; height:32px; line-height:30px; padding:0 5px; border:1px solid #FF6600;-moz-border-radius: 0px;  -webkit-border-radius: 0px;  border-radius:0px;"/> <input type="submit" value="查看" style="border:none;float:left;width:80px; height:32px; line-height:32px; padding:0 5px; background-color:#F60; text-align:center; border:none; cursor:pointer; color:#FFF;-moz-border-radius: 0px; font-size:14px;  -webkit-border-radius: 0px;  border-radius:0px;"/>  
</form></br></br>
<?php echo $p; ?>  
</div>  
</div>  
</body>  
</html> 
<?php  
} ?>

历史上的今天

很遗憾~,历史上的今天未发表过文章
技术教程

易语言注册机系列完整全套教程

2022-1-8 22:08:59

技术教程

阿里云盘列表AList部署教程

2022-1-8 23:09:34

重要说明

本站资源大多来自网络,如有侵犯你的权益请联系管理员或给邮箱发送邮件zhouqiuqiu123@foxmail.com 我们会第一时间进行审核删除。站内资源为网友个人学习或测试研究使用,未经原版权作者许可,禁止用于任何商业途径!请在下载24小时内删除!


如果遇到评论下载的文章,评论后刷新页面点击对应的蓝字按钮即可跳转到下载页面本站资源少部分采用7z压缩,为防止有人压缩软件不支持7z格式,7z解压,建议下载7-zip(点击下载),zip、rar解压,建议下载WinRAR(点击下载)

敏而好学,不耻下问。——孔子