arnchon/htmlsourceprotector

保护您的HTML源代码。

v1.4.1 2023-05-15 19:26 UTC

This package is auto-updated.

Last update: 2024-09-15 22:12:01 UTC


README

这是什么?

HTML加密器可以保护网页源代码,加密后的源代码很难被破解,但在浏览器中显示完美。AdBlocker无法读取它。它在浏览器中即时加密,只有浏览器可以读取。代码第一块的大小取决于网页大小,包含原始HTML。代码第二块始终保持相同长度,包含解码函数。在浏览器中打开时,原始页面看起来没有变化,但底下的代码已被转换。

功能

  • 保护HTML代码免受快速剪贴复制
  • 编码本地HTML以防止文件内搜索
  • 保护未完成的网站不被Google收录
  • 混淆点击“查看源代码”按钮的用户 :D
  • 成为隐形网络的一部分,隐藏于搜索引擎和数据挖掘者之前 ;)
  • 非常轻量级,且即时工作

如何安装

  • composer require omegalolbro/htmlsourceprotector

用法

  • 加密整个页面
<?php

if(file_exists('vendor/autoload.php')){
 require_once 'vendor/autoload.php';
}

if(file_exists('src/protector.php')){
 require_once 'src/protector.php';
}

if(file_exists('protector.php')){
 require_once 'protector.php';
}

$crypt = new ArnchON\HTMLSourceProtector\Crypt;
$crypt->Start();

?>
  • 加密页面中的一部分
<-- Code written above the [$html = new ArnchON\HTMLSourceProtector\Crypt;] line of code will not be encrypted-->
<-- You can put code like AdSense verification code here so the crawlers can read it -->
<script async src="https://#/pagead/js/adsbygoogle.js?client=ca-pub-0000000000000000" crossorigin="anonymous"></script>

<-- Code written under here cannot be read by crawlers -->
<?php

if(file_exists('vendor/autoload.php')){
  require_once 'vendor/autoload.php';
}

if(file_exists('src/protector.php')){
  require_once 'src/protector.php';
}

if(file_exists('protector.php')){
  require_once 'protector.php';
}

$crypt = new ArnchON\HTMLSourceProtector\Crypt;

?>

<html>
<head>
<style>
table, th, td {
  border: 1px solid black;
  border-collapse: collapse;
}
th, td {
  padding: 5px;
  text-align: left;
}
</style>
</head>
<body>
<h2>Table Caption</h2>
<p>To add a caption to a table, use the caption tag.</p>

<?php $crypt->Start(); ?>

<table style="width:100%">
  <caption>Monthly savings</caption>
  <tr>
    <th>Month</th>
    <th>Savings</th>
  </tr>
  <tr>
    <td>January</td>
    <td>$100</td>
  </tr>
  <tr>
    <td>February</td>
    <td>$50</td>
  </tr>
</table>
<?php $crypt->End(); ?>
</body>
</html>

已知问题

  • 当使用 include()require() 时可能会出现问题,请在使用模板时使用 echo(file_get_contents('filename.php'));

如果您遇到任何问题,请在此处报告

许可证

MIT License

Copyright (c) 2023 ArnchON, AI32767, HTMLSourceProtector

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.