PHP can obtain the user's intranet IP address from the external network to solve the idea

Source: Internet
Author: User
Can PHP get the user's intranet IP address from the external network?
Suppose the user connects to the Internet through a device such as routing, can get access to the user's intranet IP through PHP, namely 198.xxx.xxx.xxx such IP. This refers to the external network user access, not to get the server host intranet! IP


------Solution--------------------
There's a function you can try.










else if (@getenv ("Http_x_forwarded_for"))








}


------Solution--------------------
Take a look at the TCP principle and you'll know why.
------Solution--------------------
Generally not (unless the intranet gateway is set to a "Transparent gateway")

But even if you know, what's the point?
You can't access it back from the server!

It's like someone who wants to know where the user's uploaded files are located on the user's machine.
Since you can't access it from outside, what's the use of knowing it?
------Solution--------------------
It's not the only way to get a host.
------Solution--------------------
Independent visitors can only be judged by a cookie
------Solution--------------------
Independent visitors are cookies+ time to judge.
Will generate a cookie locally and then use the P3P.
And then every day from 0 o'clock onwards, recalculate a UV
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.