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 3 of 3
  1. #1
    Senior Coder
    Join Date
    Jun 2002
    Location
    The Netherlands, Baarn, Ut.
    Posts
    4,252
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Where should this script be?

    Hi all,

    forgive my ignorance, but i'm totally unfamiliar with Perl/CGI. A friend of mine asked me how he should incorporate a couple of guestbook scripts, being made avialable by his ISP, into his site.

    In the manual, a couple of examples listed, among other things, this link to view the guestbook contents:
    Code:
    <A HREF="/cgi-bin/gb_view.pl/guestbook/examplegb">View Guestbook</A>
    I suppose a script called "gb_view.pl" is expected to be present in a cgi-bin directory under the current root, but i can't figure out what looks to me like yet another sub-directory "guestbook" is doing there. The manual also said to create a file called "examplegb.gb" in the directory where the guestbook resides ("examplegb.data"), but which directory are they referring to?!!

    Can someone please enlighten me on this matter? Thanks in advance!
    Regards,
    Ronald.
    ronaldvanderwijden.com

  • #2
    Regular Coder
    Join Date
    Jul 2002
    Location
    London, UK
    Posts
    126
    Thanks
    0
    Thanked 0 Times in 0 Posts
    What's happening here is that the CGI script is using a slightly unusual method of passing arguments to it...

    If you call a script like this:
    /cgi-bin/script.pl/guestbook/examplegb

    Then a variable (I think it's called PATH_INFO) will be set in the %ENV hash which will give you '/guestbook/examplegb'.

    You're probably more used to something like:
    /cgi-bin/script.pl?path=/guestbook/examplegb

    Essentially I think the 'examplegb' file should be in the 'guestbook' directory in this example, which should in turn be under the document root.

  • #3
    Senior Coder
    Join Date
    Jun 2002
    Location
    The Netherlands, Baarn, Ut.
    Posts
    4,252
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Mouldy_Goat,

    thanks very much for replying; considering the number of views and the complete absence of replies, i was starting to question my post. Sorry for replying late, but i already sort of gave up hope on getting any response at all.
    What you said makes good sense; if i understand correctly:

    the directory structure under the document root and the files therein should look something like this:
    Code:
    [root]
      |
      cgi-bin:   gb_view.pl
      |
      guestbook: examplegb.data
                 examplegb.gb
    Again, thanks a lot!
    Regards,
    Ronald.
    ronaldvanderwijden.com


  •  

    Posting Permissions

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