Announcement

Collapse
No announcement yet.

Index Page

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Index Page

    Hello,

    Like to create a index page in my var/www/zoso <<< Directory it has been awhile I can get access to the contents but like to have a index list

    Thanks
    zoso

  • #2
    Here is ultra simple PHP code for that. You can add some html table and some css to make it look pretty.
    Code:
    [COLOR=#ff8c00]<?php
    $directory = [/COLOR][COLOR=#ff8c00]'/var/www/zoso[/COLOR][COLOR=#ff8c00]';[/COLOR][COLOR=#ff8c00]
    $dir = scandir($directory);
    
    
    foreach($dir as $x){
        
        echo "<a href = '{$x}'>{$x}</a> <br />";
        
    }
        [/COLOR]
    This should do the trick.
    Last edited by gulanfer; October 13, 2013, 05:28 AM.

    Comment


    • #3
      If you have Apache you can use its Directory Listings feature. Just add

      Code:
      <Directory /var/www/zoso>
        Options +Indexes
      </Directory>
      to the main configuration file (usually httpd.conf or apache2.conf) and restart Apache via a shell with 'apache2ctl restart'

      sigpic
      Sharing together - now and forever




      Comment

      Working...
      X