Jump to content

Archived

This topic is now archived and is closed to further replies.

QuadVods

Counting Files in a directory

Recommended Posts

[!--quoteo(post=375856:date=May 21 2006, 08:07 PM:name=toplay)--][div class=\'quotetop\']QUOTE(toplay @ May 21 2006, 08:07 PM) [snapback]375856[/snapback][/div][div class=\'quotemain\'][!--quotec--]
We forgot to specify the full path to the file on the is_file() function. The readdir() doesn't return a pull path and the filename, but rather just the filename.

if ((is_file($dir . $file)) && ($file != '.') && ($file != '..')) {
$count++;
}

Please try that and get back to us.
[/quote]

Parse error:....

Share this post


Link to post
Share on other sites
[!--quoteo(post=375857:date=May 21 2006, 12:13 PM:name=QuadVods)--][div class=\'quotetop\']QUOTE(QuadVods @ May 21 2006, 12:13 PM) [snapback]375857[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Parse error:....
[/quote]
There's no parse error in that code. It's somewhere else.

Parse Errors are caused by human error. Check on the line of the error, but usually one to many lines before it, for missing closing tags (i.e. ", ), }, ;, etc.).

Here's a list of what those PHP tokens seen in error messages mean:
[a href=\"http://us2.php.net/manual/en/tokens.php#tokens\" target=\"_blank\"]http://us2.php.net/manual/en/tokens.php#tokens[/a]


Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.