Posted by Martin Jay on 05/05/06 02:10
In message <4bvcqkF13n9qfU1@individual.net>, chlori <usenet314@arto.ch>
writes
>Martin Jay wrote:
>> If you can run PHP files on your server you could use something like
>> this:
>> <?php
>> $dir=""; // Directory where files are stored
>> if ($dir_list = opendir($dir))
>> {
>> while(($filename = readdir($dir_list)) !== false)
>> {
>> ?>
>> <p><a href="<?php echo $filename; ?>"><?php echo $filename;
>> ?></a></p>
>> <?php
>> }
>> closedir($dir_list);
>> }
>> ?>
>
>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. :)
There may be some more useful information in your log.
Perhaps '$dir' hasn't been set correctly. For example: my domain name
is spam-free.org.uk, but my host stores my files at:
/homepages/0/[REMOVED]/htdocs/spam-free.org.uk/
I've upload the full .php file to:
http://www.spam-free.org.uk/pages/dir.zip
And this is the sort of output you should get form it:
<http://www.spam-free.org.uk/pages/dir/>
--
Martin Jay
[Back to original message]
|