PHP Classes

File: obfuscator.php

Recommend this page to a friend!
  Classes of Rafael Espinosa   PHP Obfuscate   obfuscator.php   Download  
File: obfuscator.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Obfuscate
Obfuscate PHP encrypting the source code
Author: By
Last change:
Date: 9 years ago
Size: 693 bytes
 

Contents

Class file image Download
<?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>
"
;