Perl Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPerl Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
1200+ fellow developers rate and compare features of the top IDEs, like Visual Studio, Eclipse, RAD, Delphi and others, across 13 categories. Enjoy this FREE Download of the IDE User Satisfaction Study by Evans Data Corporation. Download Now!
  #1  
Old January 17th, 2001, 03:24 PM
d0g1e d0g1e is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Location: The Netherlands
Posts: 8 d0g1e User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to d0g1e
Exclamation

Is there a way to fool the browser to make a CGI script act like a directory? For example:

http://myserver.com/cgi-bin/my_cgi_script/somefile

my_cgi_script = the CGI script
somefile = the requested file

I want to use this for protection, so that my_cgi_script checks if the remote user is allowed to open somefile. If i could fool the webbrowser to make it look like a folder then it would be much easier. (How) Can this be done?

Thanks in advance,

d0g1e

Reply With Quote
  #2  
Old January 17th, 2001, 04:23 PM
JonLed JonLed is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Aug 2000
Location: Indiana
Posts: 614 JonLed User rank is Corporal (100 - 500 Reputation Level)JonLed User rank is Corporal (100 - 500 Reputation Level)JonLed User rank is Corporal (100 - 500 Reputation Level)JonLed User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 h 49 m 49 sec
Reputation Power: 9
Why would you need to "fool" the web browser? It doesn't know what it's requesting. /blah.cgi?/directory/file.html is no different to the browser than /blah/directory or http://www.blah.com

All the browser does is send what is requested to the server and print out what the server sends back. It could care less what's a directory and what's not.

Reply With Quote
  #3  
Old January 18th, 2001, 08:50 AM
d0g1e d0g1e is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Location: The Netherlands
Posts: 8 d0g1e User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to d0g1e
revised

This is what i mean.

------- HTML Code -------

<A HREF="bar.html">
<IMG SRC="foo.gif" ALT="bar" WIDTH="100" HEIGHT="100" BORDER="0">
</A>

------- End HTML -------

if this was the ouput of
http://foo.bar/cgi-bin/foo.cgi

the webbrowser would try to retrieve
http://foo.bar/cgi-bin/foo.gif

now, if i could access it like this
http://foo.bar/cgi-bin/foo.cgi/index.html
the browser would try to retrieve
http://foo.bar/cgi-bin/foo.cgi/foo.gif
the script would check if the client is
allowed to load foo.gif.

I would like to know if this is possible.

d0g1e

Reply With Quote
  #4  
Old January 19th, 2001, 04:39 PM
vpopper's Avatar
vpopper vpopper is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Location: Southern California
Posts: 73 vpopper User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 m 24 sec
Reputation Power: 9
Quote:
Originally posted by d0g1e
Is there a way to fool the browser to make a CGI script act like a directory? For example:

http://myserver.com/cgi-bin/my_cgi_... </table></div>

You can access "somefile" through $ENV{PATH_INFO}. Hope this helps...

Reply With Quote
  #5  
Old January 20th, 2001, 02:28 PM
d0g1e d0g1e is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Location: The Netherlands
Posts: 8 d0g1e User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to d0g1e
Smile thanks!

thanks vpopper, $ENV{"PATH_INFO"} was what I was looking
for!

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPerl Programming > Accessing CGI scripts as directories


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway