|
|||||||
Join now to share free website templates or post on the forum. If you have never been on a forum before read the
FAQ. It's quick, easy and free to join!
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
||||
|
This part has got me confused
Quote:
__________________
Consultant - Programmer - WebMaster cleandeck - lawn mower undercoating wilmargraphite - graphite lubricants |
|
||||
|
I'll see what I can do.
__________________
Consultant - Programmer - WebMaster cleandeck - lawn mower undercoating wilmargraphite - graphite lubricants |
|
||||
|
Give this a try.
<?php $total_mp3_file=count(glob("*.mp3")); echo "Currently Shuffling ".$total_mp3_file "Songs"; ?> The above example will take from the current directory. To search a specific directory you can use the following. (changes the first line) To list number of mp3 on a particular directory you can use something like this. <?php $total_mp3 = count(glob("/path/to/mp3/{*.mp3}", GLOB_BRACE)); ?> ************************************************** ********************** to simply get a count of files in a given directory <?php //get path of directory containing this script $dir = $_SERVER['DOCUMENT_ROOT'].dirname($PHP_SELF); //open a handle to the directory $handle = opendir($dir); //intitialize counter $count = 0; //loop through the directory while (false !== ($file = readdir($handle))) { //evaluate each entry, removing the . & .. entries if (is_file($file) && $file !== '.' && $file !== '..') { $count++; } } echo $count; ?> or if you prefer, assign the $file variable to an array in the loop: if...{ $files[$count] = $file; $count++; } then you can return either $count or count($files) to get your number of files.
__________________
Consultant - Programmer - WebMaster cleandeck - lawn mower undercoating wilmargraphite - graphite lubricants |
|
||||
|
Wow, I'm testing it right now!!!
Thanks!! \\\\ Ok, I get an error: Code:
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' in /home/.uris/dahost/infinisound/index.php on line 107 But, if you have any answers let me know. Thanks. |
|
||||
|
let me see your code.
__________________
Consultant - Programmer - WebMaster cleandeck - lawn mower undercoating wilmargraphite - graphite lubricants |
|
||||
|
Forgot - This error is encountered when running on PHP 4.x and on a shared hosting. Update to PHP ver 5.x and try again.
__________________
Consultant - Programmer - WebMaster cleandeck - lawn mower undercoating wilmargraphite - graphite lubricants |
|
||||
|
Quote:
I am on shared hosting, but that shouldn't really effect it because we all have our own virtual servers. So, I'm really confused on what to do. (Thanks for your help though) |
|
||||
|
Is that your girlfriend??? or is she just WOWing us.
Parse error: could be the line it is showing or it could be a line somewhere else. Hard for me to guess at, easier with the code, to look at to solve problem. Promise I won't give it away. yes you are right shared server is not a problem.
__________________
Consultant - Programmer - WebMaster cleandeck - lawn mower undercoating wilmargraphite - graphite lubricants |
![]() |
| Thread Tools | |
| Display Modes | |
|
|