Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php error_reporting(E_ALL); ini_set("\x64\x69\x73\x70\154\141\x79\137\145\162\162\x6f..

Decoded Output download

<?php 
error_reporting(E_ALL);  
ini_set("display_errors", 1);  
require "vendor/autoload.php";  
include "db.php";  
$redirect_uri = "https://" . $_SERVER["HTTP_HOST"] . "/callback.php";  
$client = new Google_Client();  
$client->setClientId($client_id);  
$client->setClientSecret($client_secret);  
$client->setRedirectUri($redirect_uri);  
$client->setAccessType("offline");  
if (isset($_GET["code"])) {  
$code = $_GET["code"];  
$accessToken = $client->fetchAccessTokenWithAuthCode($code);  
storeAccessToken(json_encode($accessToken));  
echo "Authentication successful. Redirecting.";  
function storeAccessToken($token) { file_put_contents("token.json", $token); }  
echo "<script>
\xaif (window.opener) {
    setTimeout(function() {\xd
        window.opener.location.reload(); // Reload the parent tab
\xa        window.close(); // Close the current tab (the callback tab)\xd\xa    }, 2000); // 2000 milliseconds (2 seconds) delay
\xa}
</script>
"; 
} else {  
echo "OAuth code not found or user denied consent.";  
function storeAccessToken($token) { file_put_contents("token.json", $token); }  
echo "<script>
\xaif (window.opener) {
    setTimeout(function() {\xd
        window.opener.location.reload(); // Reload the parent tab
\xa        window.close(); // Close the current tab (the callback tab)\xd\xa    }, 2000); // 2000 milliseconds (2 seconds) delay
\xa}
</script>
"; 
} ?>

Did this file decode correctly?

Original Code

<?php
error_reporting(E_ALL); 
ini_set("\x64\x69\x73\x70\154\141\x79\137\145\162\162\x6f\162\163", 1); 
require "\x76\x65\x6e\x64\157\162\x2f\141\165\164\157\x6c\157\x61\144\56\x70\x68\x70"; 
include "\144\x62\x2e\160\150\160"; 
$redirect_uri = "\150\164\164\x70\x73\x3a\x2f\x2f" . $_SERVER["\x48\x54\x54\120\137\x48\117\x53\x54"] . "\x2f\143\141\154\154\142\x61\x63\x6b\56\160\150\160"; 
$client = new Google_Client(); 
$client->setClientId($client_id); 
$client->setClientSecret($client_secret); 
$client->setRedirectUri($redirect_uri); 
$client->setAccessType("\x6f\x66\146\154\151\x6e\x65"); 
if (isset($_GET["\x63\157\144\145"])) { 
$code = $_GET["\x63\x6f\x64\x65"]; 
$accessToken = $client->fetchAccessTokenWithAuthCode($code); 
storeAccessToken(json_encode($accessToken)); 
echo "\101\x75\x74\x68\x65\x6e\164\x69\x63\141\x74\x69\x6f\x6e\40\163\x75\143\x63\x65\163\x73\x66\x75\154\56\40\122\145\144\x69\x72\145\143\x74\x69\156\147\x2e"; 
function storeAccessToken($token) { file_put_contents("\x74\x6f\x6b\x65\x6e\56\152\x73\x6f\x6e", $token); } 
echo "\74\x73\x63\x72\x69\160\164\76\15\xa\x69\x66\x20\x28\x77\151\156\x64\157\167\56\x6f\160\145\156\145\162\x29\x20\x7b\15\12\40\40\x20\x20\x73\x65\164\x54\x69\155\145\x6f\165\x74\x28\146\165\156\x63\164\x69\x6f\x6e\50\51\x20\173\xd\12\x20\x20\x20\40\x20\40\x20\x20\167\x69\156\144\x6f\x77\56\157\160\145\156\145\x72\x2e\154\157\x63\x61\164\x69\x6f\156\56\162\x65\x6c\157\x61\x64\50\51\x3b\40\57\x2f\x20\122\x65\x6c\157\x61\x64\40\x74\x68\145\40\160\x61\162\145\156\164\40\x74\141\x62\15\xa\40\40\40\x20\40\40\x20\x20\x77\151\x6e\x64\x6f\x77\x2e\143\x6c\x6f\163\145\x28\x29\73\x20\57\x2f\40\x43\154\x6f\163\145\40\164\x68\145\40\143\x75\162\162\x65\156\164\40\164\141\x62\40\50\164\x68\145\x20\x63\x61\x6c\154\142\141\x63\153\x20\x74\141\x62\x29\xd\xa\x20\x20\x20\40\175\54\40\62\60\x30\60\51\x3b\x20\57\x2f\40\x32\x30\x30\60\x20\x6d\x69\154\154\x69\163\x65\143\157\156\x64\163\x20\50\x32\40\163\x65\x63\x6f\x6e\x64\163\51\x20\144\145\x6c\141\x79\15\xa\x7d\15\12\x3c\x2f\x73\x63\162\x69\x70\x74\x3e\15\12";
} else { 
echo "\117\101\x75\164\x68\x20\143\157\144\145\x20\156\x6f\164\x20\146\157\x75\156\x64\40\157\x72\x20\x75\x73\145\162\x20\x64\145\x6e\151\145\144\40\x63\x6f\156\163\x65\x6e\164\x2e"; 
function storeAccessToken($token) { file_put_contents("\x74\x6f\x6b\x65\x6e\56\152\x73\x6f\x6e", $token); } 
echo "\74\x73\x63\x72\x69\160\164\76\15\xa\x69\x66\x20\x28\x77\151\156\x64\157\167\56\x6f\160\145\156\145\162\x29\x20\x7b\15\12\40\40\x20\x20\x73\x65\164\x54\x69\155\145\x6f\165\x74\x28\146\165\156\x63\164\x69\x6f\x6e\50\51\x20\173\xd\12\x20\x20\x20\40\x20\40\x20\x20\167\x69\156\144\x6f\x77\56\157\160\145\156\145\x72\x2e\154\157\x63\x61\164\x69\x6f\156\56\162\x65\x6c\157\x61\x64\50\51\x3b\40\57\x2f\x20\122\x65\x6c\157\x61\x64\40\x74\x68\145\40\160\x61\162\145\156\164\40\x74\141\x62\15\xa\40\40\40\x20\40\40\x20\x20\x77\151\x6e\x64\x6f\x77\x2e\143\x6c\x6f\163\145\x28\x29\73\x20\57\x2f\40\x43\154\x6f\163\145\40\164\x68\145\40\143\x75\162\162\x65\156\164\40\164\141\x62\40\50\164\x68\145\x20\x63\x61\x6c\154\142\141\x63\153\x20\x74\141\x62\x29\xd\xa\x20\x20\x20\40\175\54\40\62\60\x30\60\51\x3b\x20\57\x2f\40\x32\x30\x30\60\x20\x6d\x69\154\154\x69\163\x65\143\157\156\x64\163\x20\50\x32\40\163\x65\x63\x6f\x6e\x64\163\51\x20\144\145\x6c\141\x79\15\xa\x7d\15\12\x3c\x2f\x73\x63\162\x69\x70\x74\x3e\15\12";
}

Function Calls

None

Variables

None

Stats

MD5 a071a0141a48ebfad42c9a464c11d372
Eval Count 0
Decode Time 57 ms