Show all files of a folder

Discussion in 'PHP' started by ted_chou12, Dec 6, 2006.

  1. ted_chou12

    ted_chou12 New Member

    Joined:
    Nov 21, 2006
    Messages:
    44
    Likes Received:
    0
    Trophy Points:
    0
    Home Page:
    http://netfriending.co.cc
    sorry for taking up so much of your time, but i have one more question to ask:
    PHP:
    <?php
    $dir 
    ".";
    $file readdir($dh);
    $time date_create($file,"Y-m-d");
       if(
    $dh opendir($dir)) {
       while ((
    $file readdir($dh)) !== false){
       echo 
    "<table border=0><td><font size=5 face=\"arial\"><b>Username:</b> <a href=\"$file\">$file</a><br></font></td><td>$time</td>"."\n";}
       
    closedir($dh);}
    ?></table>
    This is a list directory php script, i want to know if it is possible to both show and hide files.
    ps. can you teach me to show and hide both specific files (ie. with specific filename), and general types,(eg. types of files with same file extension).
    THANKS, spiderman.
     
    Last edited by a moderator: Dec 7, 2006
  2. pradeep

    pradeep Team Leader

    Joined:
    Apr 4, 2005
    Messages:
    1,645
    Likes Received:
    87
    Trophy Points:
    0
    Occupation:
    Programmer
    Location:
    Kolkata, India
    Home Page:
    http://blog.pradeep.net.in
    Re: Login and Logout using Sessions and Cookies

    Your code shows all files/directories, if you do not want to show hidden files, check for the filnames/directrory names beginning with a period '.'.
     
  3. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    Re: Login and Logout using Sessions and Cookies

    I wold request you guys to make seperate thread for particular query and not use the same thread for discussing all the problems. This helps others to make searches as well.
     
  4. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    Splitted the thread from [thread=361]Login and Logout using Sessions and Cookies[/thread]
     
  5. ted_chou12

    ted_chou12 New Member

    Joined:
    Nov 21, 2006
    Messages:
    44
    Likes Received:
    0
    Trophy Points:
    0
    Home Page:
    http://netfriending.co.cc
    can you give another example for this please?
     
  6. pradeep

    pradeep Team Leader

    Joined:
    Apr 4, 2005
    Messages:
    1,645
    Likes Received:
    87
    Trophy Points:
    0
    Occupation:
    Programmer
    Location:
    Kolkata, India
    Home Page:
    http://blog.pradeep.net.in
    What exactly are you trying to acheive? And what sample code do you want??
     
  7. ted_chou12

    ted_chou12 New Member

    Joined:
    Nov 21, 2006
    Messages:
    44
    Likes Received:
    0
    Trophy Points:
    0
    Home Page:
    http://netfriending.co.cc
    nvm, thanks for bringing it up, i got it sorted.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice