473,385 Members | 1,342 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Point script "snif" to different directory?

Hi,

"Snif" is an excellent little script to index files and directories.
It's just one single file, and the advantage is that you merely drop it
into the directory you want to index, point a browser to the script and
you're done.

But to me, the simplicity is a DISadvantage since I need to index
directories that are located down in the site hierarcy, and to which the
users won't have direct access.

Have tried keeping "snif" in the directory I want indexed and then use
include to a "parent" file in root. But of course, it's indexing the
root and not the directory where the script is located. Also tried a
regular iframe, but that's plain ugly with scrollbars, etc.

So, maybe it's not kosher to ask about things like this, but I do it
anyway and hope I'm not upsetting anyone;

Can someone help me change the instances in the script which points to
"itself" so that it can index another directory?

The script is here: http://www.bitfolge.de/download/source/snif.phps

Cheers, and a BIG thanks in advance to anyone who can help.

Danny
Apr 27 '06 #1
2 2495
Danny Boy wrote:

Cheers, and a BIG thanks in advance to anyone who can help.


I'm bumping this.
I am prepared to pay for the help.
Please...
Cheers,
Danny
Apr 28 '06 #2
> "Snif" is an excellent little script to index files and directories. It's
just one single file, and the advantage is that you merely drop it into
the directory you want to index, point a browser to the script and you're
done.

But to me, the simplicity is a DISadvantage since I need to index
directories that are located down in the site hierarcy, and to which the
users won't have direct access.

Have tried keeping "snif" in the directory I want indexed and then use
include to a "parent" file in root. But of course, it's indexing the root
and not the directory where the script is located. Also tried a regular
iframe, but that's plain ugly with scrollbars, etc.


I'm sure the regulars can offer more help than I, but I think your post is
confusing. Why won't the users have direct access to the directories down
in the hierarchy? Is it outside of the public html directory? Anyway, I
think the answer to your question is found in lines 238-280 of the file you
linked (see below). If I read this correctly, there is a small index.php
file included with this snif package that you put into each subdirectory.
That automatically handles links to files below this big index.php in the
site hierarchy.

David
-----------

************************************************** **************************
** HANDLING SUBDIRECTORY LISTINGS **
************************************************** **************************

Say you've put the snif index.php into www.yourhost.com/download.
Now somebody makes a request to www.yourhost.com/download/releases. In
order to deal with this properly, you would have to copy the snif index.php
to that directory, too. But this will prevent the user to go to
www.yourhost.com/download from www.yourhost.com/download/releases
directly by selecting the .. link.

If you have this situation, use the index.php file from the subdirectory
called "subdir" in the snif archive file. All it does is automatically
forward the user to the parent directory and set URL parameters so that
the real snif will handle the request.

OK, that may be confusing. Again, a simple example:
/download/descript.ion << descriptions for
/download/*.*
/download/index.php << this file you're reading
now, >25 KB
/download/license.txt
/download/notes.txt
/download/releases/bigprogram_2.0.zip
/download/releases/descript.ion << descriptions for
/download/releases/*.*
/download/releases/index.php << subdir/index.php, <2 KB
/download/releases/nightly/2.1_20031103.zip
/download/releases/nightly/2.1_20031104.zip
/download/releases/nightly/index.php << subdir/index.php, <2 KB
If a users points his browser to
www.yourhost.com/download/releases/nightly/

The small index.php will forward him to
http://www.yourhost.com/download/rel...?path=nightly/

And then the index file in that directory will forward him again, this time
to
http://www.yourhost.com/download/?pa...eases/nightly/

Now we've reached the directory with the real snif (should get a copyright
on
that phrase ;-)), which will take over and miraculously lists the directory
the user typed as an URL.
Apr 28 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: fsidler | last post by:
Question: I use an indexing script that generates thumbnails for pictures and stores them, so the next time someone requests a directory listing, the thumbnail is already there and needn't be...
84
by: aarklon | last post by:
Hi all, I found an interesting article here:- http://en.wikipedia.org/wiki/Criticism_of_the_C_programming_language well what do you guys think of this article....??? Is it constructive...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.