Forum Moderators: coopster & phranque

Message Too Old, No Replies

Accessing the cgi-bin questions

         

Emperor

3:39 pm on Aug 14, 2005 (gmt 0)

10+ Year Member



Hi guys,

If I use the cgi-bin in an <a> does I need to set the path to it?

Here is my setup:

MySite.com
- cgi-bin
- www
- - main
- - index.html

So let's say I need a link like this on a page inside of 'main': <a href="/cgi-bin/something.cgi">

Do I have to use "../../" at the beginning to get to the proper directory?

And also, what about a SSI? Like so:

<!--#include virtual="/cgi-bin/at3/something.cgi" -->

I tried adding "../" and also "../../" to the beginning and they all work.

Will someone please explain this to me. Thank you.

volatilegx

2:48 pm on Aug 22, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes, you need to indicate the path. There are two ways to accomplish this: 1) Using a relative page or 2) using an absolute path.

The relative path would look something like: '../cgi-bin/scriptname.cgi'

The .. part indicates that the cgi-bin is in a parent directory of where the script is being called from.

An absolute path would look something like: '/MySite.com/cgi-bin/scriptname.cgi'

Note that the path begins with a / symbol. You don't see that in a relative path. The absolute path always start from your base directory and then provides the complete path from there to the CGI script.