It looks like you're new here. If you want to get involved, click one of these buttons!
if (!empty($_FILES)) {
require_once('includes/config.php');
$ext = explode('.',$_FILES['files']['name']);
if (in_array(strtolower($ext[(count($ext)-1)]),$allowed)) {
$newname = ereg_replace(\"[^A-Za-z0-9._-]\", \"\", $_FILES['files']['name']);
if (file_exists('..'.$_GET['folder'].'/'.$newname)) $result = '2';
else $result = '1';
$conn_id = ftp_connect($ftp_host);
$login_result = ftp_login($conn_id, $ftp_user, $ftp_pass);
$tempFile = $_FILES['files']['tmp_name'];
$targetPath = 'public_html'.$_GET['folder'];
$targetFile = $targetPath.'/'.$newname;
@ftp_mkdir($conn_id,$targetPath);
if (ftp_put($conn_id,$targetFile,$tempFile,FTP_BINARY)) echo $result;
else echo \"0\";
ftp_close($conn_id);
} else {
echo \"0\";
}
}