Javascript-PHP-HiddenFunctions
🚀 How to use Javascript-PHP-HiddenFunctions
This is a simple HTML + Javascript + PHP configuration to make your JS functions more hidden, in order to make it a little more difficult to access script folders, etc.
This script was created because many customers generally use simple hosting (Apache) on their domains, which often does not allow them to install a NodeJs or ReactJs server, so I developed this script to try to make access a little more difficult. to the website source.
Basically what this script does is convert the javascript function to a Base64 string and then return it as a response to an AJAX or XMLHttpRequest communication.
In this script too, on the backend side it forces checking whether the PHP file is being accessed via a direct URL or whether it is being requested by some script on the domain.
Another thing added is checking whether the HTTP_REFERER comes from the same server to avoid requests from outside the domain.And the last information is that it is passing the javascript function that comes from PHP through Headers, more specifically
header('data:'. $jsCode);
and in the page's Javascript, just use
var content = xhr.getResponseHeader('data');
eval(eval(content));
If you have any question or suggestion, please submit 😀
Agradecemos às seguintes pessoas que contribuíram para este projeto:
|
Decco Piropo |
This design is free to use.