Page 1 of 1

File count in a web dir?

Posted: Sun Jan 17, 2010 2:34 pm
by Esky
How do i see how many files there are in a folder on my website, in html/php - not using the default index page thing...?? can anyone help

Re: File count in a web dir?

Posted: Sun Jan 17, 2010 3:16 pm
by CodenStuff
Hello,

Do you mean count how many files in a folder?.
Code: Select all
<?php
$NOF=count(glob("*.*"));
echo "I counted ".$NOF.' Files in this folder';
?>
Hope that helps cooll;

Re: File count in a web dir?

Posted: Sun Jan 17, 2010 4:25 pm
by Usman55
Hello Codenstuff!

I think this is the thing that he asked! Again, I learnt a new thing!

Thanks!

Re: File count in a web dir?

Posted: Thu Jan 21, 2010 7:07 am
by Esky
Thanks so much! thats exactly what i need

Re: File count in a web dir?

Posted: Thu Jan 21, 2010 5:19 pm
by Lewis
Thats me learning something new :D
And it helped me with my programn beleve it or not :D

Re: File count in a web dir?

Posted: Tue Mar 23, 2010 7:09 pm
by DreadNought
<?php
$NOF=count(glob("*.*"));
echo "I counted ".$NOF.' Files in this folder';
?>

were does the file dir go ?

Re: File count in a web dir?

Posted: Tue Apr 27, 2010 7:40 pm
by rocky4126
paralyzer wrote:
<?php
$NOF=count(glob("*.*"));
echo "I counted ".$NOF.' Files in this folder';
?>

were does the file dir go ?
The folder would go where *.* is (in the quotes). I think that is right, ask lewis or codenstuff.

OFF TOPIC MESSAGE TO CnS:
CnS please check your inbox for my messages. It is important for my competition.

Thanks, John