How to ensure safe PHP source code authorization

(*-*)浩
Release: 2023-02-27 06:44:01
Original
2435 people have browsed it

How to ensure safe PHP source code authorization

Regarding PHP source code authorization, I saw a passage on the Internet:

The so-called domain name authorization program can only bully those who do not understand the program. For laymen, for those who are familiar with PHP, no matter how you authorize it, it can be cracked, it is just a matter of time!

That’s true, you can see the following piece of code: (Recommended learning: PHP video tutorial)

function allow_doamin(){
  $is_allow=false;
  $url=trim($_SERVER['SERVER_NAME']);
  $arr_allow_domain=array("5ixuexiwang.com");//这里可以添加多个授权域名
  foreach($arr_allow_domain as $value){
      $value=trim($value);
      $tmparr=explode($value,$url);
      if(count($tmparr)>1){
          $is_allow=true;
          break;
      }
  }
  if(!$is_allow){
      die('域名未授权!');
  }
  }
allow_doamin();
Copy after login

This will directly pass the judgment as long as you assign a value to the acquired domain name. So it's too easy for programmers to guess, even with encrypted PHP.

So how to deal with it? Some people have more complex authorization methods, which are to bring information about various servers and add a KEY as the authorization code.

After the code is encrypted, it seems to be very impressive, but if the source code is cracked and compromised, wouldn't all the judgment functions be just fish? ?

Some people say that my code is encrypted, how do you crack it? ? Not to mention, I recently saw a product on Taobao called:

There is no code that cannot be decrypted, and the price seems to be 10 yuan. I went there and a code worth at least 10,000 memorized was given away for 10 yuan, even though the store owner stated in writing that it could not be used for commercial purposes and was only for learning. hehe.

So shopnc uses core code encryption, uses the URL routing format to search the unauthorized domain name used to build this site in search engines, and then sends you a lawyer's letter. This is also a plan, so the reason should also have its own style.

So does PHP have such a licensing scheme or a very awesome one? ? I don't know either.

The above is the detailed content of How to ensure safe PHP source code authorization. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!