View Full Version : Returning HTTP_CLIENT_IP and HTTP_VIA in perl

06-16-2002, 08:23 PM
I can do it in PHP but dunno how to in perl.

Any ideas...???

06-17-2002, 02:21 PM
On the web page I pull a supposedly-JavaScript file which is actually a link to a Perl/CGI:

<script type="text/javascript" src="http://myscript.cgi"></script>

The CGI routine responds with valid JavaScript beginning with the header:

print "Content-type: text/javascript\n\n";

06-17-2002, 05:59 PM
You can get the VIA with $ENV{'HTTP_VIA'}, though you may want to set it up with an IF to see if your host supports it at first, or if it is present in the current transaction.

Same thing with client_ip... $ENV{'HTTP_CLIENT_IP'}.