<?php
if(!isset($_POST['clean_code']))
header('Location: index.php');
require_once(__DIR__ . DIRECTORY_SEPARATOR . "vendor/autoload.php");
$obfuscator = new \Fluency\Component\Obfuscator\PhpObfuscator();
$cleanFileName = md5(uniqid()) . ".php";
file_put_contents($cleanFileName, $_POST['clean_code']);
$obfuscatedFileName = $obfuscator->obfuscate($cleanFileName);
$obfuscatedCode = file_get_contents($obfuscatedFileName);
unlink(__DIR__ . DIRECTORY_SEPARATOR . $cleanFileName);
unlink(__DIR__ . DIRECTORY_SEPARATOR . $obfuscatedFileName);
echo "
<h2>PHP Online Code Obfuscator</h2>
<textarea cols=\"50\" rows=\"30\">{$obfuscatedCode}</textarea>
<a href=\"index.php\">Go Back</a>
";
|