Shoutbox

Need some help =] - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Skype & Technology (/forumdisplay.php?fid=9)
+---- Forum: Tech Talk (/forumdisplay.php?fid=17)
+----- Thread: Need some help =] (/showthread.php?tid=85886)

Need some help =] by Th3rmal on 09-11-2008 at 11:05 AM

ok you know how directories in websites (such as www.th3rmal.com/nothing ) are automatically updated when you upload something?

how would i do that, except with an index page, so like i want www.th3rmal.com/myschool automatically updated, which it doesnt atm...


RE: Need some help =] by roflmao456 on 09-11-2008 at 08:11 PM

using PHP :P

code:
function dirList ($directory)
{

    // create an array to hold directory list
    $results = array();

    // create a handler for the directory
    $handler = opendir($directory);

    // keep going until all files in directory have been read
    while ($file = readdir($handler)) {

        // if $file isn't this directory or its parent,
        // add it to the results array
        if ($file != '.' && $file != '..')
            $results[] = $file;
    }

    // tidy up: close the handler
    closedir($handler);

    // done!
    return $results;

}

will return an array in which you would have to loop through the items and echo/print them
RE: Need some help =] by felipEx on 09-11-2008 at 08:26 PM

Why don't you use an Apache module called mod_autoindex? :p Have a look at this tutorial


RE: Need some help =] by Th3rmal on 09-11-2008 at 08:40 PM

Atm, rofl just helped me with the php, but ill also check out the Apache one as well :)


RE: Need some help =] by Spunky on 09-11-2008 at 08:54 PM

I'm currently using this php script on http://spunkylovemuff.co.uk and it's pretty cool, easy to customize, allows for file uploads, hidden folder and custom file type images and thumbnails of image files. :p


RE: Need some help =] by Th3rmal on 09-11-2008 at 09:15 PM

quote:
Originally posted by SpunkyLoveMuff
this php script
page not found :(

EDIT: nvm got it

EDIT2: Wow thanks slm, script works a treat and looks real nice to :)
RE: Need some help =] by Jarrod on 09-11-2008 at 09:47 PM

i swear there is already a thread on this.

edit: hey there is tid=74044