如何给PHP网页加密码访问?php页面加密访问源码

本文共2584个字,预计阅读时间需要7分钟 发布时间: 2023-03-5 共345人阅读


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

  1. <!– (^ω^)=☞源码下载: 页头开始–>
  2. <?php
  3. header(‘Content-type:text/html;charset=utf-8’);
  4. $password = “zygx”; // 这里是正确密码
  5. $p = “”;
  6. if(isset($_COOKIE[“isview”]) && $_COOKIE[“isview”] == $password){
  7. $isview = true;
  8. }else{
  9. if(isset($_POST[“pwd”])){
  10. if($_POST[“pwd”] == $password){
  11. setcookie(“isview”,$_POST[“pwd”],time()+3600*0.2);
  12. $isview = true;
  13. }else{
  14. $p = (empty($_POST[“pwd”])) ? “需要密码才能查看,请输入密码。(扫码回复:2468)” : “密码不正确,请重新输入。(扫码回复:2468)”;
  15. }
  16. }else{
  17. $isview = false;
  18. $p = “如果你对本页反感,请立即关闭!谢谢!</br>关注微信公众号:小辉网络(SSN5068)回复:2468 即可获取密码!”;
  19. }
  20. }
  21. if($isview){ ?>
  22. <!– (^ω^)=☞源码下载: 页头结束–>

将下面代码添加最后

  1. <!– (^ω^)=☞源码下载: 页尾开始–>
  2. <?php }else{ ?>
  3. <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” ” http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
  4. <html xmlns=” http://www.w3.org/1999/xhtml”>
  5. <head>
  6. <meta http-equiv=“Content-Type” content=“text/html; charset=utf-8” />
  7. <meta http-equiv=“pragma” content=“no-cache” />
  8. <meta http-equiv=“cache-control” content=“no-cache” />
  9. <meta http-equiv=“expires” content=“0” />
  10. <title>Q绑查询</title>
  11. <meta name=“keywords” content=“PHP加密”>
  12. <meta name=“description” content=“PHP加密”>
  13. <!–[if lt IE 6]>
  14. <style type=”text/css”>
  15. .z3_ie_fix{
  16. float:left;
  17. }
  18. </style>
  19. <![endif]–>
  20. <style type=“text/css”>
  21. body{
  22. background:none;
  23. }
  24. .passport{
  25. border:1px solid red;
  26. background-color:#FFFFCC;
  27. width:400px;
  28. height:150px;
  29. position:absolute;
  30. left:49.9%;
  31. top:49.9%;
  32. margin-left:-200px;
  33. margin-top:-55px;
  34. font-size:14px;
  35. text-align:center;
  36. line-height:30px;
  37. color:#746A6A;
  38. }
  39. .post-content-post {
  40. border: 1px dashed #F60;
  41. padding: 10px;
  42. margin: 10px 0;
  43. line-height: 200%;
  44. color: #F00;
  45. background-color: #FFF4FF;
  46. overflow: hidden;
  47. clear: both;
  48. }
  49. </style>
  50. <div class=“post-content-post”>
  51. <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;>
  52. <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>
  53. 输入查看密码<form action=“” method=“post” style=margin:0px;>
  54. <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;/>
  55. </form></br></br>
  56. <?php echo $p; ?>
  57. </div>
  58. </div>
  59. </body>
  60. </html>
  61. <?php
  62. } ?>
  63. <!– (^ω^)=☞源码下载: 页尾结束–>

我们有时候建一个页面不想让别人看到,或者必须得经过你的允许才能看到!那么就可以用到以上的php代码

转载文章,请保留出处,(www.sfzyw.com)感谢您的支持
首发资源网 » 如何给PHP网页加密码访问?php页面加密访问源码

常见问题FAQ

链接地址失效了怎么办?
例如蓝奏盘,https://www.lanzous.com/i1b2oib 把S改成m或i即可解决,或者请联系本站修复!
本站资源和文章版权声明
版权声明:本站部分文章来源或改编自互联网及其他公众平台,主要目的在于分享信息,版权归原作者所有,内容仅供读者参考,如有侵权请联系我们,减少损失。联系邮箱:1453316800@qq.com
点击下载链接不跳转怎么回事?
您好,QQ内打开是不跳转的,少部分浏览器也不跳转,一般的谷歌,UC了,搜狗 360等浏览器都可以跳转。

发表回复

提供最优质的资源集合

立即查看 了解详情