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
    Regular Coder
    Join Date
    Jun 2002
    Location
    England
    Posts
    172
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Returning HTTP_CLIENT_IP and HTTP_VIA in perl

    I can do it in PHP but dunno how to in perl.

    Any ideas...???

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    Flint, Michigan, USA
    Posts
    629
    Thanks
    1
    Thanked 20 Times in 20 Posts
    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";

  • #3
    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
    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'}.
    Moderator, Perl/CGI Forum
    shadowstorm.net - subvert society


  •  

    Posting Permissions

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