New SIMPLE upload script not workin
Posted: Sat Feb 14, 2004 11:28 pm
It will show the file being transfered. And it will go all the way through without any errors. But when i go to my ftp and look in the upload directory nothing is there. CHMOD is 777 btw. Heres the code.
form.php
upload.php
form.php
Code: Select all
<?
if(!eregi("modules.php", $_SERVERї'PHP_SELF'])){
die("You can't access this file directly...");
}
$module_name = basename(dirname(__FILE__));
$module_dir = "modules/$module_name/";
include("header.php");
$index = 1;//right sidebar or not 0=off 1=on
title("Submit Band info/Mp3's");
OpenTable();
?>
<br>You may upload TWO mp3s that are no more than 3.5mb each. If one mp3 is more than
3.5mb. You may only upload ONE. If you do not abide by this rule all information will be Discarded.
<br>
<FORM ACTION="http://naild.com/localmm/modules?=Bands_Showcase&file=upload" METHOD="POST" ENCTYPE="multipart/form-data">
Browse to files:<BR>
<INPUT TYPE="FILE" NAME="firstfile" SIZE="50"><BR>
<INPUT TYPE="FILE" NAME="secondfile" SIZE="50"><BR>
<INPUT TYPE="SUBMIT">
</FORM>
<?php
CloseTable();
include("footer.php");
?>Code: Select all
<?php
$uploaddir = "/localmm/upload/";
$uploadfile1 = $uploaddir . $_FILESї'firstfile']ї'name'];
$uploadfile2 = $uploaddir . $_FILESї'secondfile']ї'name'];
if (!move_uploaded_file($_FILESї'firstfile']ї'tmp_name'], $uploadfile1)) {
print "ERROR: File is invalid";
print_r($_FILES);
}
if (!move_uploaded_file($_FILESї'secondfile']ї'tmp_name'], $uploadfile2)) {
print "ERROR: File is invalid";
print_r($_FILES);
}
?>