How to bind the website to the domain?

how to make a reference to the domain to a different domain, you cannot use the script. When when the script is loaded on another domain just stopped working completely. + how to encode the code to not be able to change? Possible with examples
June 14th 19 at 19:09
2 answers
June 14th 19 at 19:11
Obfuscation, crypts, binding of iron (here, domain) - that's what he asked
Can explain how to do it? At least approximately - Jody85 commented on June 14th 19 at 19:14
June 14th 19 at 19:13
Simple solution "on the knee":

index.php

<?php
define("index", 1);
....
include_once "my_cool_script.inc.php";
....
?>


my_cool_script.inc.php

<?php
if ( !defined("index") ) {
die();
}
// script code here
?>


I.e. if the script my_cool_script.inc.php will be called if not the specific constant index (e.g., the browser will be gaining https://your_site.ru/my_cool_script.inc.php), it will fail.

Find more questions by tags PHP