Hello, while searching the web I found a code that can do a VERY simple upload which is exactly what I need.
I would like some one to take a look at it and see if they can make this code work with my scammer mod Please.
Thank you.
<?php
// If the number of files have not been set, show the first form
if ((!isset($_GET['num'])) || (empty($_GET['num']))) { ?>
" method="get">
Number of files to upload:
<?php
for ($x = 1; $x <= 3; $x++) {
echo ''.$x.'';} ?>
<?php
} else {
// else, show the upload form
// get the integer value of $_GET['num']
$num = intval($_GET['num']);?>
" /> <?php
// show the file input field $num times
// name the fields file1,file2,file3...
for ($x = 1; $x <= $num; $x++) {
echo 'File '.$x.': ';} ?>
<?php
} ?>
<?php
// Upload directory
$dir = 'localhost/test/uploads/';
$num = $_POST['num'];
$messages = array();
for ($x = 1; $x <= $num; $x++) {
$file = $_FILES['file'.$x];
if (! is_uploaded_file($file['tmp_name'])) {
$messages[$x-1] = 'File '.$x.': No file selected.';
continue; }
if (! move_uploaded_file($file['tmp_name'],$dir.$file['name'])) {
$messages[$x-1] = 'File '.$x.': Unable to move file.';
continue;
} else {
$messages[$x-1] = 'File '.$x.': Uploaded...'; }
}
foreach ($messages as $msg) { echo $msg.''; }
?>