Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Aug 2002
    Location
    paris - france
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Macintosh newbie : setting up cgi-bin path on html page

    Hi!
    I need to know how to write the path to my cgi-bin on the html page that will call the script.
    my account is set up as follows :
    /
    cgi-bin
    documents
    index.htm

    of course, if I write on the index file:
    <a href=/cgi-bin/script.cgi>
    it's not going to work, since it not at the same level.
    Any suggestions!
    thanks for your help

    Stephane

  • #2
    Regular Coder Feyd's Avatar
    Join Date
    May 2002
    Location
    Los Angeles, CA Maxim: Subvert Society
    Posts
    403
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Not exactly...an initial slash, such as you have in your example, will more often than not indicate that this is in reference to the root directory, so that /cgi-bin/ will always point to the correct path no matter where in the directory you are. This is Virtual Directories.

    Now, if you just had cgi-bin/whatever.pl, your assumption would be correct. Almost exclusively, servers have cgi-bin set up as a virtual directory so that that initial slash method works even if virtual directories are not enabled.

    And, you can always use the full path to your script (yourname.com/etc.), though it may prove annoying for you tending on how many domains you have and what kind of globalization scripts you may be using...
    Moderator, Perl/CGI Forum
    shadowstorm.net - subvert society

  • #3
    New to the CF scene
    Join Date
    Aug 2002
    Location
    paris - france
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanks for your answer, but....
    I tried that : <a href=cgi-bin/Hello.cgi>Hello.cgi</a>
    and did get a 404, which -forgive me, I'm not familiar with virtual directories- makes sense since the cgi-bin directory is one level "above" the directory (entitled "documents") that holds the index.

    I assume that from the title of the documents, you'll understand that I am making real easy on myself !
    I've been waiting for a clear answer from my host (pointhost), but could'nt get anything more than "you got perl installed".
    May be I could move the cgi-bin directory down to the level of the index ?
    thanks for your help!

    Stephane (hi from rainy Paris!)

  • #4
    Regular Coder Feyd's Avatar
    Join Date
    May 2002
    Location
    Los Angeles, CA Maxim: Subvert Society
    Posts
    403
    Thanks
    0
    Thanked 0 Times in 0 Posts
    As I previously indicated, using /cgi-bin/ as an href or form action is the most common application, though some servers can have customization that alters or negates that practice. You should not be trying to use cgi-bin/.

    If you are using the initial slash (/cgi-bin) then it does not matter what page is calling the link, get it? root/dir/file.php linking to /cgi-bin/ is always going to be equivalent to root/cgi-bin/, no matter what cwd you are currently in.

    A lot of people seem to have a problem grasping virtual directory linking, but it is quite simple...

    You should be using <a href=/cgi-bin/Hello.cgi>Hello.cgi</a>, and if that does not work, your host has some non-standard configurations and your only work-around may be to use a full url path to your bin.
    Moderator, Perl/CGI Forum
    shadowstorm.net - subvert society

  • #5
    New Coder
    Join Date
    Jul 2002
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts
    If your cgi-bin directory above the page you're calling it from try <a href="../cgi-bin/whatever.cgi">whatever</a> .. is the directory above you so it should work, unless you've got some weird stuff set up on your server...


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •