prolly need some sleep for ($i .....

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

Post Reply
User avatar
ol4pr0
Forum Regular
Posts: 926
Joined: Thu Jan 08, 2004 11:22 am
Location: ecuador

prolly need some sleep for ($i .....

Post by ol4pr0 »

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 »

$1000000
Is that a variable? ;)
User avatar
ol4pr0
Forum Regular
Posts: 926
Joined: Thu Jan 08, 2004 11:22 am
Location: ecuador

Post by ol4pr0 »

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 »

What error does it give you now?
User avatar
ol4pr0
Forum Regular
Posts: 926
Joined: Thu Jan 08, 2004 11:22 am
Location: ecuador

Post by ol4pr0 »

NO error .. just doesnt rename the file
stoyan
Forum Newbie
Posts: 3
Joined: Thu Apr 22, 2004 2:13 am
Contact:

Post by stoyan »

User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

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?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

I'm having serious trouble understanding what the loop is for other than filling the server with that file..
magicrobotmonkey
Forum Regular
Posts: 888
Joined: Sun Mar 21, 2004 1:09 pm
Location: Cambridge, MA

Post by magicrobotmonkey »

lose the @ and see what error you get!
User avatar
Wayne
Forum Contributor
Posts: 339
Joined: Wed Jun 05, 2002 10:59 am

Post by Wayne »

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 »

I think thats been said a few times already...
Post Reply