Page 3 of 4
Posted: Fri Feb 20, 2004 6:05 am
by Illusionist
lol, no... if your going to do it that then take the "$dir = out
should be:
Code: Select all
copy($_FILES['userfile']['tmp_name'], $_SERVER['DOCUMENT_ROOT'] . "/home/hsphere/local/home/monkeyj/monkeyblast.com/anims/upload"); ");
Posted: Fri Feb 20, 2004 6:39 am
by John Cartwright
There is a parse error is because you had an extra quotatation and ;
Code: Select all
<?php
copy($_FILES['userfile']['tmp_name'], $_SERVER['DOCUMENT_ROOT'] . "/home/hsphere/local/home/monkeyj/monkeyblast.com/anims/upload"));
?>
Sorry MOnkey I completely forgot about this thread, when I get home I will send you an easier script
Posted: Fri Feb 20, 2004 8:10 am
by Illusionist
parse error here is because you have an extra parenthesis
Code: Select all
<?php
copy($_FILES['userfile']['tmp_name'], $_SERVER['DOCUMENT_ROOT'] . "/home/hsphere/local/home/monkeyj/monkeyblast.com/anims/upload");
?>
another error
Posted: Fri Feb 20, 2004 4:30 pm
by monkeyj
another parse error
Parse error: parse error in /home/hsphere/local/home/monkeyj/monkeyblast.com/submit.php on line 9
Code: Select all
<?php
if (is_uploaded_file($_FILESї'userfile']ї'tmp_name'])) {
copy($_FILESї'userfile']ї'tmp_name'], $_SERVERї'DOCUMENT_ROOT'].
"/home/hsphere/local/home/monkeyj/monkeyblast.com/anims/upload");
} else {
echo "Possible file upload attack. Filename: " . $_FILESї'userfile']ї'name'];
}
/* ...or... */
move_uploaded_file($_FILESї'userfile']ї'tmp_name'], $dir = $_SERVERї'DOCUMENT_ROOT'] . "/home/hsphere/local/home/monkeyj/monkeyblast.com/anims/upload"; );
?>
Posted: Fri Feb 20, 2004 4:30 pm
by monkeyj
ok, nvm.. stupid.. forgot the second.. sorry
Posted: Fri Feb 20, 2004 4:34 pm
by monkeyj
thx btw
Posted: Fri Feb 20, 2004 4:40 pm
by monkeyj
Gah.. Another error
Warning: copy(/hsphere/local/home/monkeyj/monkeyblast.com/anims/upload): failed to open stream: Is a directory in /home/hsphere/local/home/monkeyj/monkeyblast.com/submit.php on line 4
Warning: move_uploaded_file(/hsphere/local/home/monkeyj/monkeyblast.com/anims/upload): failed to open stream: Is a directory in /home/hsphere/local/home/monkeyj/monkeyblast.com/submit.php on line 10
Warning: move_uploaded_file(): Unable to move '/tmp/phpx8f14u' to '/hsphere/local/home/monkeyj/monkeyblast.com/anims/upload' in /home/hsphere/local/home/monkeyj/monkeyblast.com/submit.php on line 10
Code: Select all
<?php
if (is_uploaded_file($_FILESї'userfile']ї'tmp_name'])) {
copy($_FILESї'userfile']ї'tmp_name'], $_SERVERї'DOCUMENT_ROOT'].
"/anims/upload");
} else {
echo "Possible file upload attack. Filename: " . $_FILESї'userfile']ї'name'];
}
/* ...or... */
move_uploaded_file($_FILESї'userfile']ї'tmp_name'], $_SERVERї'DOCUMENT_ROOT'].
"/anims/upload");
?>
Posted: Fri Feb 20, 2004 4:42 pm
by monkeyj
I changed the /home/hsphere..
yall suggested..
cause the earlier error just like copied that.. so it was doubled..
home/hspere/monkeyblast.com/home/hspere...
u get the point
Posted: Fri Feb 20, 2004 4:48 pm
by ol4pr0
if server on a linux login with ssh or something..
chmod 777 /home/and/some/dir/to/follow/
you also might wanna check that the directory that youre trying to access indeed is there..
Posted: Fri Feb 20, 2004 5:13 pm
by monkeyj
well..
I've 777'd it..
ran it.. tried to uploada gif and.. i still get error:
Warning: copy(/hsphere/local/home/monkeyj/monkeyblast.com/upload): failed to open stream: Is a directory in /home/hsphere/local/home/monkeyj/monkeyblast.com/submit.php on line 4
Warning: move_uploaded_file(/hsphere/local/home/monkeyj/monkeyblast.com/upload): failed to open stream: Is a directory in /home/hsphere/local/home/monkeyj/monkeyblast.com/submit.php on line 10
Warning: move_uploaded_file(): Unable to move '/tmp/phpUJy3EU' to '/hsphere/local/home/monkeyj/monkeyblast.com/upload' in /home/hsphere/local/home/monkeyj/monkeyblast.com/submit.php on line 10
Also: I changed the file to just /upload
instead of anims/upload
Umm, I have an idea...
How bout I just give one of you access to my folders and you do it for me? lol
Posted: Fri Feb 20, 2004 5:15 pm
by Illusionist
are those folder even where you say they are?
Posted: Fri Feb 20, 2004 5:25 pm
by monkeyj
I have a new script..
I found for free
FREE
Free
wee
wee
wee
Umm
I uploaded it..
and..
It works..
But..
I never looked through the coding..
so..
I still don't know what I did wrong..
But thanks everyone for your patience and understanding in my newb quest to understand PHP..
RAWR
meow
-Monkeyj
Posted: Fri Feb 20, 2004 5:26 pm
by Illusionist
lol, post the new code and your old code, i'd liek to see the differences! lol
If you don't mind!
Posted: Fri Feb 20, 2004 5:43 pm
by monkeyj
Hell, the New code has about 4 files.. 1 for the style/way it looks... 2 for the actual script
3 for the way the page looks..
4 for the form or something
Posted: Fri Feb 20, 2004 5:43 pm
by monkeyj
but ok, one sec