Loading ...
Sorry, an error occurred while loading the content.
 

HTTP Header

Expand Messages
  • JHILMIL JAIN
    Hi, Can anyone please tell me how to access and parse the HTTP header from any browser using Perl? Thanks, Jhilmil.
    Message 1 of 5 , Aug 3, 2001
      Hi,
      Can anyone please tell me how to access and parse the
      HTTP header from any browser using Perl?

      Thanks,
      Jhilmil.

      __________________________________________________
      Do You Yahoo!?
      Get personalized email addresses from Yahoo! Mail
      http://personal.mail.yahoo.com/
    • jonathansamuel@yahoo.com
      ... I want to get information about which user is using my ... It is often impossible to read a user s identity and email address from his http
      Message 2 of 5 , Aug 5, 2001
        --- In perl-beginner@y..., JHILMIL JAIN <jhilmiljain@y...> wrote:
        \> I want to get information about which user is using my
        > application and his ip address + his email address if
        > possible.
        >

        It is often impossible to read a user's identity and email address
        from his http transmission. After all, the user may not wish you to
        know this information.

        It is always, however, possible to know the user's IP address. The
        following script shows how to do it when using the Apache webserver.
        You can see this script in action at
        http://www.jonathanmark.com/ipreader.pl

        The script will return the user's login id if the user has
        authenticated himself to the webserver. Most websites do not require
        authentication, however.

        You can find out more about the CGI module, which is built in to
        modern versions of Perl, at
        http://stein.cshl.org/WWW/software/CGI/cgi_docs.html

        ####################################################
        use strict;
        use LWP;
        use HTTP::Request::Common;

        use constant ALX_ENTER => 'http://www.alxnet.com';
        use constant ALX_REFERER => 'http://www.alxnet.com';


        my $ua = LWP::UserAgent->new;
        my $newagent = 'enter_alxnet/1.0 (' . $ua->agent . ')';
        $ua->agent($newagent);

        my $request = POST (ALX_ENTER, Content => [email
        => 'jonathansamuel@...', passwd => 'mangohouse426'], Referer =>
        ALX_REFERER);
        my $response = $ua->request($request)->as_string;
        print $response;
      • jonathansamuel@yahoo.com
        Here is the right one. use CGI; use strict; my $q = new CGI; print $q- header, $q- start_html( IP Address Reader ); print $q- h2( Your browser s IP address is
        Message 3 of 5 , Aug 5, 2001
          Here is the right one.

          use CGI;
          use strict;
          my $q = new CGI;
          print $q->header, $q->start_html('IP Address Reader');
          print $q->h2("Your browser's IP address is " . $q->remote_host());
          print $q->h2($q->remote_user() . " is logged in.") if $q->remote_user
          ();
          print $q->end_html();
        • Frank J. Schmuck
          I m running RH 7.1. The installed version of Perl was 5.6.0 for i386 placed in /usr/bin. I installed Bundle::CPAN which then prompted to upgrade my version
          Message 4 of 5 , Aug 5, 2001
            I'm running RH 7.1. The "installed" version of Perl was 5.6.0 for i386
            placed in /usr/bin. I installed Bundle::CPAN which then prompted to upgrade
            my version of Perl to match my machine. So now I have 5.6.1 for i586 placed
            in /usr/local/bin.

            Am I going to have any problems here? Do I need to remove the other Perl
            and if so, how? When I install new modules and the source is complied will
            it be placed in the correct local?

            Thanks
            Frank
          • erik.tank@bpxinternet.com
            It s funny that you ask that at this time. At work we are migrating from Perl 5.005 to 5.6.1, so for some time we will have both installations on 1 server. As
            Message 5 of 5 , Aug 6, 2001
              It's funny that you ask that at this time. At work we are migrating from
              Perl 5.005 to 5.6.1, so for some time we will have both installations on 1
              server.

              As far as we know/believe/wax philosophically (mind you we are starting the
              migration this week so I may have to revise my answer when it is all over
              ;-) ) each installation of Perl will be total separate. Everything hinges
              upon which Perl interpreter you call. In your case when you call
              /usr/bin/perl you will get the 5.6.0 installation and if you call
              /usr/local/bin/perl you will get the 5.6.1 installation. When installing
              something from CPAN you will need to make sure you are calling the correct
              Perl interpreter. If you are used to typing "cpan" at the prompt then you
              will need to that somewhere the cpan command has been set up to be script
              for: "perl -MCPAN -e shell". Of course in your case you will want to make
              sure that it is pointing to the correct interpreter.

              When we are done with our migration we plan on renaming the old Perl
              interpreter and setting up a symbolic link to the new interpreter so that we
              should not have any problems. I would recommend at least doing this. That
              way you know that you are always using the correct one.

              Hope that helps,

              Erik Tank
              602-817-4705
              erik.tank@...


              -----Original Message-----
              From: Frank J. Schmuck [mailto:fschmuck@...]
              Sent: Sunday, August 05, 2001 6:11 PM
              To: perl-beginner@yahoogroups.com
              Subject: [PBML] Two Perls on Same Machine


              I'm running RH 7.1. The "installed" version of Perl was 5.6.0 for i386
              placed in /usr/bin. I installed Bundle::CPAN which then prompted to upgrade
              my version of Perl to match my machine. So now I have 5.6.1 for i586 placed
              in /usr/local/bin.

              Am I going to have any problems here? Do I need to remove the other Perl
              and if so, how? When I install new modules and the source is complied will
              it be placed in the correct local?

              Thanks
              Frank





              Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
            Your message has been successfully submitted and would be delivered to recipients shortly.