PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
ol4pr0
Forum Regular
Posts: 926 Joined: Thu Jan 08, 2004 11:22 am
Location: ecuador
Post
by ol4pr0 » Wed Apr 21, 2004 10:54 pm
Parse error: parse error, expecting `T_VARIABLE' or `'$'' in debug.php on line 115
Code: Select all
$ext = strrchr($file_name,'.');
if (($limit_ext == "yes") && (!in_array($ext,$extensions))) {
$endresult = "<font size="2">File is wrong type</font>";
}else{
for ($i=0; $i<$1000000; $i++) // line 115
{
@copy($file, "$absolute_path/$file_name[$i]")
or $endresult = "<font size="2">Couldn't Copy File To Server</font>";
}
d3ad1ysp0rk
Forum Donator
Posts: 1661 Joined: Mon Oct 20, 2003 8:31 pm
Location: Maine, USA
Post
by d3ad1ysp0rk » Wed Apr 21, 2004 10:57 pm
$1000000
Is that a variable?
ol4pr0
Forum Regular
Posts: 926 Joined: Thu Jan 08, 2004 11:22 am
Location: ecuador
Post
by ol4pr0 » Wed Apr 21, 2004 11:00 pm
lol... nope i need to rename the file.. with a number
however still doesnt work.. and yea i need some sleep ( realizing that some more now ..
d3ad1ysp0rk
Forum Donator
Posts: 1661 Joined: Mon Oct 20, 2003 8:31 pm
Location: Maine, USA
Post
by d3ad1ysp0rk » Wed Apr 21, 2004 11:01 pm
What error does it give you now?
ol4pr0
Forum Regular
Posts: 926 Joined: Thu Jan 08, 2004 11:22 am
Location: ecuador
Post
by ol4pr0 » Wed Apr 21, 2004 11:08 pm
NO error .. just doesnt rename the file
stoyan
Forum Newbie
Posts: 3 Joined: Thu Apr 22, 2004 2:13 am
Contact:
Post
by stoyan » Thu Apr 22, 2004 2:23 am
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098 Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia
Post
by Chris Corbyn » Thu Apr 22, 2004 2:32 am
stoyan, that was pointed out in the first reply but even then, the errors stopped yes. Only problem was that the file doesn't get renamed.
How about....
Code: Select all
@copy($file, "$absolute_path/$file_name.$i")
To deal with the file rename problem. Are you just trying to append the number to the filename or completely rename it?
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Thu Apr 22, 2004 2:36 am
I'm having serious trouble understanding what the loop is for other than filling the server with that file..
Wayne
Forum Contributor
Posts: 339 Joined: Wed Jun 05, 2002 10:59 am
Post
by Wayne » Thu Apr 22, 2004 6:58 am
Code: Select all
for ($i=0; $i<$1000000; $i++) // line 115
you cant do that .... if $1000000 is an actual variable you can't start its name with a number so make it $_1000000 ... if you want to use the value 1000000 than just put
Code: Select all
for ($i=0; $i<1000000; $i++) // line 115
magicrobotmonkey
Forum Regular
Posts: 888 Joined: Sun Mar 21, 2004 1:09 pm
Location: Cambridge, MA
Post
by magicrobotmonkey » Thu Apr 22, 2004 7:00 am
I think thats been said a few times already...