[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Getting server name from Environment



At 14.57 97/3/13, Russell Aminzade wrote:
>I've got a nice CGI script that implements a general-purpose
>multiple-choice quiz engine and it's up and running on a server at a local
>college, but he would really like to trap the name and server of the person
>connecting up.  I've seen some perl CGI libraries do this, but I can't
>remember where.  (I'm just using a few lines adapted from cgi.pl to do the
>work).
>
>Does anyone know how I can retrieve this? It couldn't just be a
>$ENV{'something'}, could it?

Well, I'm not sure exactly what you want, but I made a script that gives
you ALL CGI envvars here:

        http://www.petersons.com/cgi-bin/env2.pl

All the $ENV hash keys and values are there.  Your mileage may vary,
depending on your browser software.

What I think you want, though, is $ENV{'REMOTE_HOST'} or $ENV{'REMOTE_ADDR'}.

One more thing: this is a CGI question, not a MacPerl question, or even a
Perl question.  Please use the appropriate forum for such questions.  I
suggest the comp.infosystems.www.authoring.cgi newsgroup.

#================================================================
Chris Nandor                                      pudge@pobox.com
PGP Key 1024/B76E72AD                           http://pudge.net/
Keyfingerprint = 08 24 09 0B CE 73 CA 10  1F F7 7F 13 81 80 B6 B6