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 $ip = $_SERVER['REMOTE_ADDR']; if(isset($_FILES["file"]["type"])) { $validexte..

Decoded Output download

<?php 
 
$ip = $_SERVER['REMOTE_ADDR']; 
if(isset($_FILES["file"]["type"])) 
{ 
$validextensions = array("jpeg", "jpg", "png"); 
$temporary = explode(".", $_FILES["file"]["name"]); 
$file_extension = end($temporary); 
if ((($_FILES["file"]["type"] == "image/png") || ($_FILES["file"]["type"] == "image/jpg") || ($_FILES["file"]["type"] == "image/jpeg") 
) && ($_FILES["file"]["size"] > 100) 
&& in_array($file_extension, $validextensions)) { 
if ($_FILES["file"]["error"] > 0) 
{ 
echo "Return Code: " . $_FILES["file"]["error"] . "<br/><br/>"; 
} 
else 
{ 
if (file_exists("upload/".$ip."_". $_FILES["file"]["name"])) { 
echo " <span id='invalid'></span> "; 
} 
else 
{ 
// Storing source path of the file in a variable 
$sourcePath = $_FILES['file']['tmp_name'];  
$targetPath = "upload/".$ip."_". $_FILES["file"]["name"]; 
move_uploaded_file($sourcePath,$targetPath) ;  
echo "<span id=success' ></span>"; 
} 
} 
} 
else 
{ 
echo "<span id='invalid'>Invalid Size or Type<span>"; 
} 
} 
?>

Did this file decode correctly?

Original Code

<?php

$ip = $_SERVER['REMOTE_ADDR'];
if(isset($_FILES["file"]["type"]))
{
$validextensions = array("jpeg", "jpg", "png");
$temporary = explode(".", $_FILES["file"]["name"]);
$file_extension = end($temporary);
if ((($_FILES["file"]["type"] == "image/png") || ($_FILES["file"]["type"] == "image/jpg") || ($_FILES["file"]["type"] == "image/jpeg")
) && ($_FILES["file"]["size"] > 100)
&& in_array($file_extension, $validextensions)) {
if ($_FILES["file"]["error"] > 0)
{
echo "Return Code: " . $_FILES["file"]["error"] . "<br/><br/>";
}
else
{
if (file_exists("upload/".$ip."_". $_FILES["file"]["name"])) {
echo " <span id='invalid'></span> ";
}
else
{
// Storing source path of the file in a variable
$sourcePath = $_FILES['file']['tmp_name']; 
$targetPath = "upload/".$ip."_". $_FILES["file"]["name"];
move_uploaded_file($sourcePath,$targetPath) ; 
echo "<span id=success' ></span>";
}
}
}
else
{
echo "<span id='invalid'>Invalid Size or Type<span>";
}
}
?>

Function Calls

None

Variables

$ip None

Stats

MD5 4126e6e3010ebd6da843482f82e494ed
Eval Count 0
Decode Time 95 ms