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 extract($_POST); //session_id($msess); $_POST['sess']=$msess; include "resiz..
Decoded Output download
<?php
extract($_POST);
//session_id($msess);
$_POST['sess']=$msess;
include "resize.php";
include "init.php";
$mid=$_SESSION['id'];
echo "---->$msess";
$nameorig=basename($_FILES['fphoto']['name']); // nombre original
$uploadfile = strtolower("tmp/upload/$nameorig"); // subirlo a un directorio temporal
@unlink($uploadfile);
//echo "--->".$_FILES['fphoto']['name']."<------";
move_uploaded_file($_FILES['fphoto']['tmp_name'], $uploadfile);
$inf=pathinfo($uploadfile);
$ext=$inf['extension'];
$newname=$uploadfile;
//$newwidth=0; $newheight=0;
if (list($width, $height, $type, $attr) = getimagesize($uploadfile)){
$fisname=resizeto($uploadfile,640,$ext);
$newname=$fisname;
} else {
if ($mtype=='img'){
$imp.="parent.upimageerror('No es un archivo de imagen...');
";
$act='';
}
}
switch($act){
case "profile":
$str="SELECT * FROM $tb_users WHERE id=$mid";
$q=mysql_query($str);
if ($rr=mysql_fetch_array($q)){
$newname=newfile("data/44x42",$ext);
$x=new dsf_minthumb($fisname);
$thumname="data/44x42/th-$newname.$ext";
$x->create($thumname,44,42);
list($width, $height, $type, $attr) = getimagesize($fisname);
$maxwidth=163;
// $maxwidth=128; OTRA DIMENSION
if ($width>$maxwidth){
$height=$height*($maxwidth/$width);
$width=$maxwidth;
}
$thumname="data/prfl/pf-$newname.$ext";
$x->create($thumname,$width,$height);
@unlink($uploadfile);
$str="UPDATE $tb_users SET thumb='$newname.$ext' WHERE id=$mid";
mysql_query($str);
$q=_ss('*',$tb_users,"id=$mid");
$r=mysql_fetch_array($q);
extract($r);
$str="INSERT INTO $tb_files (id_us,realname,fisicname,album) VALUES ($id_us,'$nameorig','$fisname','$album')";
mysql_query($str);
$usdata="$sex|$age|$thumb|$uinfo";
$str="UPDATE $tb_online SET data='$usdata' WHERE id=$mid";
mysql_query($str);
$info="$id|$user|$stt|1|$usdata";
_ss('i',$tb_mess,'mtyp,mfrom,mdest,mref,mmess,mtime',"'msg',0,0,'000000','s_changprof|$info',$now");
$imp="parent.mythumb('$thumb');
";
} else {
$imp="parent.systemalert(0,'Error al subir imagen','No te encuentras registrado');
";
}
break;
}
function resizeto($uploadfile,$maxfilesize,$ext){
list($width, $height, $type, $attr) = getimagesize($uploadfile);
$newname=newfile("data/source",$ext);
$fisname="data/source/im-$newname.$ext";
$max=($width>$height)?$width:$height;
if ($max>$maxfilesize){
$newwidth=($width/$max)*$maxfilesize;
$newheight=($height/$max)*$maxfilesize;
//echo "2---->".$this->image;
$x=new dsf_minthumb($uploadfile);
$x->create($fisname,$newwidth,$newheight);
@unlink($uploadfile);
} else {
rename($uploadfile,$fisname);
}
return $fisname;
}
function newfile($path,$ext){
if (!is_dir($path)) return '';
do{
$fil=strtolower(dechex(rand(65536,1048575)));
} while(is_file("$path/$fil.$ext"));
return $fil;
}
?>
<script>
<?php echo $imp;?>;
</script>
Did this file decode correctly?
Original Code
<?php
extract($_POST);
//session_id($msess);
$_POST['sess']=$msess;
include "resize.php";
include "init.php";
$mid=$_SESSION['id'];
echo "---->$msess";
$nameorig=basename($_FILES['fphoto']['name']); // nombre original
$uploadfile = strtolower("tmp/upload/$nameorig"); // subirlo a un directorio temporal
@unlink($uploadfile);
//echo "--->".$_FILES['fphoto']['name']."<------";
move_uploaded_file($_FILES['fphoto']['tmp_name'], $uploadfile);
$inf=pathinfo($uploadfile);
$ext=$inf['extension'];
$newname=$uploadfile;
//$newwidth=0; $newheight=0;
if (list($width, $height, $type, $attr) = getimagesize($uploadfile)){
$fisname=resizeto($uploadfile,640,$ext);
$newname=$fisname;
} else {
if ($mtype=='img'){
$imp.="parent.upimageerror('No es un archivo de imagen...');\r\n";
$act='';
}
}
switch($act){
case "profile":
$str="SELECT * FROM $tb_users WHERE id=$mid";
$q=mysql_query($str);
if ($rr=mysql_fetch_array($q)){
$newname=newfile("data/44x42",$ext);
$x=new dsf_minthumb($fisname);
$thumname="data/44x42/th-$newname.$ext";
$x->create($thumname,44,42);
list($width, $height, $type, $attr) = getimagesize($fisname);
$maxwidth=163;
// $maxwidth=128; OTRA DIMENSION
if ($width>$maxwidth){
$height=$height*($maxwidth/$width);
$width=$maxwidth;
}
$thumname="data/prfl/pf-$newname.$ext";
$x->create($thumname,$width,$height);
@unlink($uploadfile);
$str="UPDATE $tb_users SET thumb='$newname.$ext' WHERE id=$mid";
mysql_query($str);
$q=_ss('*',$tb_users,"id=$mid");
$r=mysql_fetch_array($q);
extract($r);
$str="INSERT INTO $tb_files (id_us,realname,fisicname,album) VALUES ($id_us,'$nameorig','$fisname','$album')";
mysql_query($str);
$usdata="$sex|$age|$thumb|$uinfo";
$str="UPDATE $tb_online SET data='$usdata' WHERE id=$mid";
mysql_query($str);
$info="$id|$user|$stt|1|$usdata";
_ss('i',$tb_mess,'mtyp,mfrom,mdest,mref,mmess,mtime',"'msg',0,0,'000000','s_changprof|$info',$now");
$imp="parent.mythumb('$thumb');\r\n";
} else {
$imp="parent.systemalert(0,'Error al subir imagen','No te encuentras registrado');\r\n";
}
break;
}
function resizeto($uploadfile,$maxfilesize,$ext){
list($width, $height, $type, $attr) = getimagesize($uploadfile);
$newname=newfile("data/source",$ext);
$fisname="data/source/im-$newname.$ext";
$max=($width>$height)?$width:$height;
if ($max>$maxfilesize){
$newwidth=($width/$max)*$maxfilesize;
$newheight=($height/$max)*$maxfilesize;
//echo "2---->".$this->image;
$x=new dsf_minthumb($uploadfile);
$x->create($fisname,$newwidth,$newheight);
@unlink($uploadfile);
} else {
rename($uploadfile,$fisname);
}
return $fisname;
}
function newfile($path,$ext){
if (!is_dir($path)) return '';
do{
$fil=strtolower(dechex(rand(65536,1048575)));
} while(is_file("$path/$fil.$ext"));
return $fil;
}
?>
<script>
<?php echo $imp;?>;
</script>
Function Calls
| extract | 1 |
Stats
| MD5 | 3fc1d5670d165c18303315be6bf11763 |
| Eval Count | 0 |
| Decode Time | 159 ms |