Go Back   Novahq.net Forum > phphq.Net > phphq.Net Forums
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
  #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
  #2  
Old 02-09-2005, 11:03 AM
Scott is offline Scott
Scott's Avatar
AKA. Panther

Join Date: Sep 2001
Location: Minneapolis, MN
Posts: 10,922

I got the error "Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in c:\server\www\test.php on line 22"

Anyways, it's to do with your chmod command. You have a " after 0777, there should be no ".
[code:1:00b3e55bd2]
@chmod("/home/site/www/".$name, 0777);
[/code:1:00b3e55bd2]
And I would actually recoment for use on a wider range of systems,
[code:1:00b3e55bd2]
@chmod("/home/site/www/".$name, octdec("0777"));
[/code:1:00b3e55bd2]
__________________

04' Dodge SRT-4, Mopar Stage 3, 406whp/436wtq
Reply With Quote
  #3  
Old 02-23-2005, 12:58 PM
~BLÃÐE~
Unregistered

Posts: n/a

try adding your url in the config.php
www.yoursite.com/folder/Uploader/
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
a simple question with no answer KU43 Humor & Jokes 1 12-22-2007 11:43 PM
Another Question, Plz Answer °»ÐÑ«° Delta Force 3 04-19-2006 05:57 PM
Question, Plz Answer °»ÐÑ«° Delta Force 2 04-19-2006 04:05 PM
Do you know the answer to this question? SilentTrigger General Chat 11 03-04-2006 08:45 AM
Question plzz answer nocky Sigs and Graphics 1 11-12-2003 05:26 PM


All times are GMT -5. The time now is 05:33 AM.




Powered by vBulletin®