(Link to AcmlmWiki) Offline: thank ||bass
Register | Login
Views: 13,040,846
Main | Memberlist | Active users | Calendar | Chat | Online users
Ranks | FAQ | ACS | Stats | Color Chart | Search | Photo album
05-18-24 01:42 AM
0 users currently in Programming.
Acmlm's Board - I3 Archive - Programming - Quick HTML question New poll | |
Add to favorites | Next newer thread | Next older thread
User Post
Young Guru

Snifit








Since: 11-18-05
From: Notre Dame, IN

Last post: 6304 days
Last view: 6298 days
Posted on 12-15-05 11:56 PM Link | Quote
Is there anyway to see the contents of a directory in a browser if the directory has an index.html file in it?


(edited by Young Guru on 12-15-05 10:57 PM)
Sukasa

Birdo
Not quite as active as before.
Xkeeper supporter
Xk > ||bass
I IP Banned myself! Twice!








Since: 11-17-05
From: Somewhere over there

Last post: 6299 days
Last view: 6298 days
Posted on 12-16-05 01:06 AM Link | Quote
So far as I know, you can't. Sorry.
Vystrix Nexoth



 





Since: 11-26-05
From: Cascadia

Last post: 6725 days
Last view: 6725 days
Posted on 12-16-05 02:55 AM Link | Quote
That's a browser question, not an HTML question. I know in Konqueror it's under View -> Use index.html, but I'm going to go out on a limb and guess that you're actually using Windows/Internet Explorer... in which case I don't know what needs to be done, though I recall something about "View as web page" but can't find anything to that effect on this machine.
HyperHacker

Star Mario
Finally being paid to code in VB! If only I still enjoyed that. <_<
Wii #7182 6487 4198 1828


 





Since: 11-18-05
From: Canada, w00t!
My computer's specs, if anyone gives a damn.
STOP TRUNCATING THIS >8^(

Last post: 6298 days
Last view: 6298 days
Posted on 12-16-05 03:01 AM Link | Quote
That depends. Are you trying to view a directory on a server or your hard drive? Or are you setting up a site? AFAIK no server system will give you a directory listing if an index page exists (unless you trick it somehow); it's a bit of a security concern. However, when I view my own HD in lololol via file:///, it always lists them.

If you want to set up a directory that still lists its contents with an index page, I think .htaccess has such a setting. Or you could rename the index page.
Young Guru

Snifit








Since: 11-18-05
From: Notre Dame, IN

Last post: 6304 days
Last view: 6298 days
Posted on 12-16-05 11:27 AM Link | Quote
I use lololol and I run my website off my school server. It's just that the server is really anal and if you don't capitalize everything correctly it doesn't work, so when I'm not at my computer where I can directly access my files it's sometimes hard to remember how to get to some files. But it appears that it can't be done cause I've looked through all my folders and I'm not seeing a .htaccess file. Thanks for the help.
FreeDOS +

Giant Red Koopa
Legion: freedos = fritos








Since: 11-17-05
From: Seattle

Last post: 6298 days
Last view: 6298 days
Posted on 12-16-05 03:48 PM Link | Quote
If they have an index.html fed automatically by the server, then no you can't. (The Konqueror thing only works for protocols that give you the files directly, eg FTP or locally stored things)

By the way, just about every server is case-sensitive. It's not just your school's server.
Young Guru

Snifit








Since: 11-18-05
From: Notre Dame, IN

Last post: 6304 days
Last view: 6298 days
Posted on 12-16-05 05:21 PM Link | Quote
Well, i guess the only other server that I was used to using was my highschool server which was run by one of the students. I think I remember not having to worry about capitalization so I guess he might've changed that in our server.
emcee

Red Super Koopa


 





Since: 11-20-05

Last post: 6298 days
Last view: 6298 days
Posted on 12-16-05 09:40 PM Link | Quote
Do you have cgi access?

If so try this (make sure to save it as index.pl):
#!/usr/local/bin/perl
$dir=$ENV{'QUERY_STRING'} or $dir='.';
$dir=~s/[\/\\]$//;
opendir(DIR,$dir);
print "Content-type: text/html\n\n";
print '<html><head><title>Directory Listing for '.$dir.'<body><pre>Name Last Modified Size<hr>';
foreach(readdir(DIR))
{
$m=-M($dir.'/'.$_);
$s=-s($dir.'/'.$_);
print '<a href="'.(-d($dir.'/'.$_) ? 'index.pl?' : '').$dir.'/'.$_.'">'.$_.'</a>'.((' ' x (30 - scalar(length($_))))).scalar(localtime(time - ($m*86400))).(' ' . int($s/1024) . 'K<br>');
}
print '</pre></body></html>';
closedir(DIR);

Really this isn't a very secure solution however, since you can browse the entire server, rather than just your files, but it wouldn't be to hard to add a password.


(edited by emcee on 12-16-05 08:41 PM)
Vystrix Nexoth



 





Since: 11-26-05
From: Cascadia

Last post: 6725 days
Last view: 6725 days
Posted on 12-18-05 08:44 PM Link | Quote
if ($dir =~ /\.\./ or $dir =~ /^\//) {

# deny access
}

That'll sort out a number of problems.
emcee

Red Super Koopa


 





Since: 11-20-05

Last post: 6298 days
Last view: 6298 days
Posted on 12-18-05 11:35 PM Link | Quote
True, however depending where you put the script you may want access to a higher directory. I was thinking putting something like this before accessing files (after extracting $pass from $ENV{'QUERY_STRING'}, preferably with CGI.pm for better security):

unless(crypt('pass','xx') eq 'encryptedpass')
{
die('access denied');
}

Doesn't matter really though since he hasn't replied he likely doesn't have cgi access and/or doesn't know what I'm talking about. That and you've been banned so you probably won't even read this.
HyperHacker

Star Mario
Finally being paid to code in VB! If only I still enjoyed that. <_<
Wii #7182 6487 4198 1828


 





Since: 11-18-05
From: Canada, w00t!
My computer's specs, if anyone gives a damn.
STOP TRUNCATING THIS >8^(

Last post: 6298 days
Last view: 6298 days
Posted on 12-19-05 06:25 AM Link | Quote
I dunno how you'd do it in a CGI script, but just filtering '..' from the path should work. On a Windows system you might need to block ':' too to stop using absolute paths (C:\), not really sure.
Add to favorites | Next newer thread | Next older thread
Acmlm's Board - I3 Archive - Programming - Quick HTML question |


ABII

Acmlmboard 1.92.999, 9/17/2006
©2000-2006 Acmlm, Emuz, Blades, Xkeeper

Page rendered in 0.009 seconds; used 397.38 kB (max 491.75 kB)