Browser for folders.

N

none

Hi.

I have a site where I want to automatic list folders below.
index.htm -> where I want the foldernames below.
folder1
folder2
folder3


So my question is how can I do this with js or cgi


Regards Rstormo
 
M

mynameisnobodyodyssea

Hi.

I have a site where I want to automatic list folders below.
index.htm -> where I want the foldernames below.
        folder1
        folder2
        folder3

So my question is how can I do this with js or cgi

Regards Rstormo

What do you mean?
Like the option of showing the current folder content
at a URL http://yourdomain.com/somefolder/
where the index file is missing?
 
N

none

What do you mean?
Like the option of showing the current folder content
at a URL http://yourdomain.com/somefolder/
where the index file is missing?
Yes that sounds like exactly what I mean.

some javascript, php or something. Tried php scandir() but that command
was not allowed. So maybee my server have an older version.


Regards rstormo
 
M

mynameisnobodyodyssea

Yes that sounds like exactly what I mean.

some javascript, php or something. Tried php scandir() but that command
was not allowed. So maybee my server have an older version.

Regards rstormo

You must be careful because this could add
extra links to be followed by search engines and
it might affect the way your site is crawled
by search engines and it might affect search results.

You can set at server level the way a URL
http://yourdomain/somefolder/
appears if there is no index file there.
If you have something like cpanel, have a look at
Advanced > Index Manager
For an Apache server that would add specific to your choices
Options and IndexOptions lines
to your .htaccess files.
 
N

none

You must be careful because this could add
extra links to be followed by search engines and
it might affect the way your site is crawled
by search engines and it might affect search results.

You can set at server level the way a URL
http://yourdomain/somefolder/
appears if there is no index file there.
If you have something like cpanel, have a look at
Advanced > Index Manager
For an Apache server that would add specific to your choices
Options and IndexOptions lines
to your .htaccess files.
I understand that, but I need a script to do so. This because I will
have something more on that index page.
The page would have design but the folders are automatic generated.

Regards rstormo
 
N

none

Maybe look at the PHP function opendir,
http://uk3.php.net/opendir
Thank you for pointing me in the right direction.

This was what I looked for.

-snip
<html><body>
<?php
$dir = "./";

// Open a known directory, and proceed to read its contents
if (is_dir($dir)) {
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false) {
echo "filename: $file : filetype: " . filetype($dir .
$file) . "\n";
}
closedir($dh);
}
}
?>
</body>
</html>
-snap


Regards Rstormo
 
M

mynameisnobodyodyssea

Thank you for pointing me in the right direction.

Regards Rstormo

With your links automatically generated,
I repeat, check that they are OK to be crawled by
search engines, check that your robots.txt file
is up to date.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top