Created
July 30, 2018 14:35
-
-
Save oddmario/36bf944a08fdcc8c38c1efc831a17a2b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function ProtectMyCode($html) { | |
$complex_html = str_replace(array("\r","\n"),"",$html); | |
$encoded = base64_encode($complex_html); | |
session_start(); | |
$_SESSION['jsvar'] = chr(rand(65,90)).chr(rand(65,90)).chr(rand(65,90)).chr(rand(65,90)).chr(rand(65,90)).chr(rand(65,90)).chr(rand(65,90)).chr(rand(65,90)).chr(rand(65,90)); | |
$_SESSION['divid'] = chr(rand(65,90)).chr(rand(65,90)).chr(rand(65,90)).chr(rand(65,90)).chr(rand(65,90)).chr(rand(65,90)).chr(rand(65,90)).chr(rand(65,90)).chr(rand(65,90)); | |
echo ' | |
<script> | |
var '.$_SESSION['jsvar'].' = atob("'.$encoded.'"); | |
window.onload = function(){ | |
document.getElementById("'.$_SESSION['divid'].'").innerHTML = '.$_SESSION['jsvar'].'; | |
} | |
</script> | |
<div id="'.$_SESSION['divid'].'"></div> | |
'; | |
session_unset(); | |
session_destroy(); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment