Jump to content

Funker_joe

Members
  • Posts

    5
  • Joined

  • Last visited

Posts posted by Funker_joe

  1. What code did you use?

    I used the second code aliendisaster posted.Also, the php version installed is: 4.3.11
    <?php $totalFiles = 0;$dirname = "test01";if(!($dh=opendir($dirname))) die("Couldn't find ".$dirname);while (!(($file = readdir($dh)) === false)){  if (is_file("$test01/$file")){      $totalFiles ++;  }}closedir($dh);?>

    I changed it to that.Then, I made the index file have:

    <a href="01122.htm"><?php echo "$totalFiles"; ?></a>

    Everything seems to be fine, but the link always shows up as 0, no matter if I add files to the dir or not.

  2. I get this error:Parse error: parse error, unexpected T_LNUMBER, expecting T_VARIABLE or '$' in /home/profile/public_html/watm/php/01.php on line 5

  3. Hello,I was wondering how I would go about having a number readout of how many files are in a given directory. Then that number would be displayed in the htm document.Sorry if this sound stupid, but I've never typed anything in PHP before.Thanks,-Joe

×
×
  • Create New...