View Single Post
  #1  
Old 02-08-2005, 11:29 PM
PHP-Largo
Unregistered

Posts: n/a

File uploading question, please answer!

Hey this keeps on getting an error... :

Qoute:

Parse error: parse error, unexpected '.' in /home/waradmn/public_html/fileuploader.php on line 22


[code:1:ca70bda09f]
<?
/***Upload File Script***/
/*Uploading File*/
/*
In This script we will be allowing a user
to upload their file, and of course, host it
, their signature, or image! */
if(isset($userfile))
{

if("multipart/x-zip"==$_FILES['userfile']['type'])
{
$zip="home/site/www/";
$uploadfile = $zip . $_FILES['userfile']['name'];
if(move_uploaded_file($_FILES['userfile']['tmp_nam e'],$uploadfile))
{
$file=$_FILES['userfile']['name'];
$name=$_FILES['userfile']['name'];
$debug=$_FILES;

@chmod("/home/site/www/".$name, 0777");
echo"$name is now uploaded and hosted. To have a download link to it click <a href=\"www.wargamershq.com/home/www/files\">here</a>";
}else{
echo"A problem with uploading your file occured! <b>DEBUG:</b>";
print_r($_FILES);
}
}else{
echo"Wrong file type! It must be in .zip extention!";
}
}
?>
[/code:1:ca70bda09f]
Reply With Quote