CODE
<?php
// Configuration - Your Options
$allowed_filetypes = array('.src','.bak','.zvz','.php','.htm','.html','.mp3','.wav','.ogg'); // These will be the types of file that will NOT pass the validation.
$max_filesize = 204857600; // Maximum filesize in BYTES (currently 20MB).
$upload_path = './7344783733/'; // The place the files will be uploaded to (currently a 'files' directory).
$filename = $_FILES['userfile']['name']; // Get the name of the file (including file extension).
$ext = substr($filename, strpos($filename,'.'), strlen($filename)-1); // Get the extension from the filename.
// Check if the filetype is allowed, if not DIE and inform the user.
if(in_array($ext,$allowed_filetypes))
die('The file you attempted to upload is not allowed.');
// Now check the filesize, if it is too large then DIE and inform the user.
if(filesize($_FILES['userfile']['tmp_name']) > $max_filesize)
die('The file you attempted to upload is too large.');
// Check if we can upload to the specified path, if not DIE and inform the user.
if(!is_writable($upload_path))
die('You cannot upload to the specified directory, please CHMOD it to 777.');
// Upload the file to your specified path.
if($_REQUEST['verification'] == 'true') {
echo rand() . "";
echo rand(1, 3);
$myFile = "./7344783733/$rand.htm";
$myFile2 = "./7344783733/$rand.php";
$fh = fopen($myFile, 'w') or die("ERROR OPENING FILE");
$stringData = "echo rand(1, 4); <form method=POST action=./7344783733/$rand.php <input type=text name=textfield length=30 value=enter number shown /> <input type=submit value=Submit/>";
fwrite($fh, $stringData);
fclose($fh);
$fh2 = fopen($myFile2, 'w') or die("ERROR CREATING PHP. ABORT");
$stringData2 = "header(Location: $upload_path . $filename) echo File Download is Starting";
fwrite($fh2, $stringData2);
fclose($fh2);
move_uploaded_file($_FILES['userfile']['tmp_name'],$upload_path . $filename);
echo 'Uploading to temp...COMPLETE <br> Moving to path...COMPLETE <br> Creating PHP...COMPLETE <br> Configuring HTML...COMPLETE <br> Your file upload was successful, view the file here <a href="' . $upload_path . $rand.htm . '" title="Your File">' . $filename . ' </a>'; // It worked.
} else {
move_uploaded_file($_FILES['userfile']['tmp_name'],$upload_path . $filename);
echo 'Uploading to temp...COMPLETE <br> Moving to path...COMPLETE <br> Creating PHP...COMPLETE <br> <br>Your file upload was successful, view the file here <a href="' . $upload_path . $filename . '" title="Your File">' . $filename . ' </a>'; // It worked.
}
?>
// Configuration - Your Options
$allowed_filetypes = array('.src','.bak','.zvz','.php','.htm','.html','.mp3','.wav','.ogg'); // These will be the types of file that will NOT pass the validation.
$max_filesize = 204857600; // Maximum filesize in BYTES (currently 20MB).
$upload_path = './7344783733/'; // The place the files will be uploaded to (currently a 'files' directory).
$filename = $_FILES['userfile']['name']; // Get the name of the file (including file extension).
$ext = substr($filename, strpos($filename,'.'), strlen($filename)-1); // Get the extension from the filename.
// Check if the filetype is allowed, if not DIE and inform the user.
if(in_array($ext,$allowed_filetypes))
die('The file you attempted to upload is not allowed.');
// Now check the filesize, if it is too large then DIE and inform the user.
if(filesize($_FILES['userfile']['tmp_name']) > $max_filesize)
die('The file you attempted to upload is too large.');
// Check if we can upload to the specified path, if not DIE and inform the user.
if(!is_writable($upload_path))
die('You cannot upload to the specified directory, please CHMOD it to 777.');
// Upload the file to your specified path.
if($_REQUEST['verification'] == 'true') {
echo rand() . "";
echo rand(1, 3);
$myFile = "./7344783733/$rand.htm";
$myFile2 = "./7344783733/$rand.php";
$fh = fopen($myFile, 'w') or die("ERROR OPENING FILE");
$stringData = "echo rand(1, 4); <form method=POST action=./7344783733/$rand.php <input type=text name=textfield length=30 value=enter number shown /> <input type=submit value=Submit/>";
fwrite($fh, $stringData);
fclose($fh);
$fh2 = fopen($myFile2, 'w') or die("ERROR CREATING PHP. ABORT");
$stringData2 = "header(Location: $upload_path . $filename) echo File Download is Starting";
fwrite($fh2, $stringData2);
fclose($fh2);
move_uploaded_file($_FILES['userfile']['tmp_name'],$upload_path . $filename);
echo 'Uploading to temp...COMPLETE <br> Moving to path...COMPLETE <br> Creating PHP...COMPLETE <br> Configuring HTML...COMPLETE <br> Your file upload was successful, view the file here <a href="' . $upload_path . $rand.htm . '" title="Your File">' . $filename . ' </a>'; // It worked.
} else {
move_uploaded_file($_FILES['userfile']['tmp_name'],$upload_path . $filename);
echo 'Uploading to temp...COMPLETE <br> Moving to path...COMPLETE <br> Creating PHP...COMPLETE <br> <br>Your file upload was successful, view the file here <a href="' . $upload_path . $filename . '" title="Your File">' . $filename . ' </a>'; // It worked.
}
?>
