Go4Expert

Go4Expert (http://www.go4expert.com/)
-   PHP (http://www.go4expert.com/forums/php/)
-   -   Show all files of a folder (http://www.go4expert.com/forums/files-folder-t2161/)

ted_chou12 6Dec2006 15:31

Show all files of a folder
 
sorry for taking up so much of your time, but i have one more question to ask:
PHP Code:

<?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.

pradeep 7Dec2006 11:54

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 '.'.

shabbir 7Dec2006 13:44

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.

shabbir 7Dec2006 13:46

Re: Show all files of a folder
 
Splitted the thread from Login and Logout using Sessions and Cookies

ted_chou12 7Dec2006 21:16

Re: Show all files of a folder
 
can you give another example for this please?

pradeep 15Dec2006 18:31

Re: Show all files of a folder
 
What exactly are you trying to acheive? And what sample code do you want??

ted_chou12 15Dec2006 19:18

Re: Show all files of a folder
 
nvm, thanks for bringing it up, i got it sorted.


All times are GMT +5.5. The time now is 19:51.