REMOTE_ADDR via HTTPS

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Pat

    REMOTE_ADDR via HTTPS

    Hi,

    I am having a small problem with a script that has to be requested via
    https.

    When I execute this normally I get my IP address printed on the
    screen:

    <?php
    echo getenv('REMOTE_ ADDR');
    ?>

    However the same script executed over https gives me a completetly
    different address.

    How to I read the clients IP address via https?

    Thanks for any advice.
  • Michael Fuhr

    #2
    Re: REMOTE_ADDR via HTTPS

    patkay_156@yaho o.co.uk (Pat) writes:
    [color=blue]
    > I am having a small problem with a script that has to be requested via
    > https.
    >
    > When I execute this normally I get my IP address printed on the
    > screen:
    >
    > <?php
    > echo getenv('REMOTE_ ADDR');
    > ?>[/color]

    You can also use $_SERVER['REMOTE_ADDR'].
    [color=blue]
    > However the same script executed over https gives me a completetly
    > different address.[/color]

    Have you investigated what that address is? Does your browser have
    a proxy configuration that makes it connect differently depending
    on whether you're using HTTP or HTTPS? Have you run a packet sniffer
    on your machine and/or the web server to see if that address really
    is involved in the connection?
    [color=blue]
    > How to I read the clients IP address via https?[/color]

    The above methods should work.

    --
    Michael Fuhr

    Comment

    Working...