Reply to Re: list files from directory on a site [1/2 solved]

Your name:

Reply:


Posted by chlori on 05/05/06 12:25

Martin Jay wrote:
>> I get an "Internal Server Error". Any ideas?
>>
>> Is there some server config stopping it from working or am I doing
>> something wrong?

> Hmmm, I haven't seen that non-specific error since my Perl days. :)

The problem is solved:
When I changed the permissions for the script from 666 to 644 it works.
Don't know why, but it works...

My next questions:
- If I have files and directories it lists both the same way. I would
like to add a class="dir" to the directory links so I can change the
look with CSS.
- The List shows ".", ".." and ".htaccess". How can I hide these?

BTW, I'm using this script:

<?php

$dir="/home/xyxy/public_html/xyxyx/files";

if ($dir_list = opendir($dir))
{
while(($filename = readdir($dir_list)) !== false)
{
?>
<li><a href="files/<?php echo $filename; ?>"><?php echo $filename;
?></a></li>
<?php
}
closedir($dir_list);
}

?>

--
chlori

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация