#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2001
    Location
    The Netherlands
    Posts
    8
    Rep Power
    0

    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
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Aug 2000
    Location
    Indiana
    Posts
    614
    Rep Power
    15
    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.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2001
    Location
    The Netherlands
    Posts
    8
    Rep Power
    0

    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
  6. #4
  7. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Location
    Southern California
    Posts
    73
    Rep Power
    15
    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_script/somefile


    You can access "somefile" through $ENV{PATH_INFO}. Hope this helps...
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2001
    Location
    The Netherlands
    Posts
    8
    Rep Power
    0

    Smile thanks!


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

IMN logo majestic logo threadwatch logo seochat tools logo