display client ip address on web page

Ask a Question related to PERL Miscellaneous, Design and Development.

  1. #1

    Default display client ip address on web page

    I need help writing a script that will display a web client's ip
    address on my web page.

    I am running apache on linux. I have perl installed.
    Joe Guest

  2. Similar Questions and Discussions

    1. Retrieving REAL client ip address
      Hello, I was wondering if there is a way using coldfusion with java, to get the real client ip address even if he/she is behind a proxy or using...
    2. Getting client IP address
      Anyone know how to get the client IP address? As part of the authentication/stats/logging system, we'd like to have all IPs stored in the...
    3. How do I grab the client IP address in my Web service
      Hi, I need to grab the ip address of the computer making the call to my Web Service. In my .asmx I tried System.Web.HttpRequest.UserHostName and...
    4. IP Address display in Application log for MX
      In CF5, the IP Address of the user that generated a page error is listed in the Application log along with the description of the page error. This...
    5. Outlook address display
      When you send a mass mailing (like my newsletter) to a group of addreses, the recepient receives it together with a long list of all other recepients...
  3. #2

    Default Re: display client ip address on web page

    In article <a911e5d5.0307221130.11f88871@posting.google.com >,
    [email]joe_stevensen@yahoo.com[/email] (Joe) wrote:
    > I need help writing a script that will display a web client's ip
    > address on my web page.
    >
    > I am running apache on linux. I have perl installed.
    It doesn't even have to be a Perl script, if you have your HTML pages
    set up as server parsed (for server side includes). Just include this
    code:

    <!--#echo var="REMOTE_ADDR"-->

    See: [url]http://httpd.apache.org/docs/howto/ssi.html[/url] for more info.

    (Sorry for the off-topic answer, but in this case it's justified, IMHO,
    since the easiest answer is not to use Perl.)

    --
    Dan Wilga [email]dwilga-MUNGE@mtholyoke.edu[/email]
    ** Remove the -MUNGE in my address to reply **
    Dan Wilga Guest

  4. #3

    Default Re: display client ip address on web page

    On 22 Jul 2003 12:30:04 -0700, [email]joe_stevensen@yahoo.com[/email] (Joe) wrote:
    >I need help writing a script that will display a web client's ip
    >address on my web page.
    >
    >I am running apache on linux. I have perl installed.
    #!/usr/local/bin/perl
    print "Content-type: text/plain","\n\n";

    $remote_host = $ENV{'REMOTE_HOST'};
    print "You are visiting from ", $remote_host, ". ";

    I just copied and pasted the above from here:

    [url]http://www.oreilly.com/openbook/cgi/ch01_06.html[/url]

    you can add any tags, like this:

    print "<html><body>Hi there</body></html>";
    Steve in NY Guest

  5. #4

    Default Re: display client ip address on web page

    That will teach me to post before thinking...thanks Todd ;-)

    On Tue, 22 Jul 2003 20:14:49 GMT, "Todd de Gruyl" <todd@tdegruyl.com> wrote:
    >On Tue, 22 Jul 2003 16:03:41 -0700, Steve in NY wrote:
    >
    >> print "Content-type: text/plain","\n\n";
    >...
    >> print "<html><body>Hi there</body></html>";
    >
    >of course, if you want that to display as html, change the content-type to
    >text/html, instead of text/plain
    Steve in NY Guest

  6. #5

    Default Re: display client ip address on web page


    "Joe" <joe_stevensen@yahoo.com> wrote in message
    news:a911e5d5.0307221130.11f88871@posting.google.c om...
    > I need help writing a script that will display a web client's ip
    > address on my web page.
    >
    > I am running apache on linux. I have perl installed.
    It isn't possible to determine the IP address the users to your website.
    The best you can do is determine the address of where the request has come
    from (or at least, claims to have come from).


    Tintin Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139