SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Hybrid View

  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2011
    Posts
    62
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Client IP to my localhost

    I want to assign client IP which i got from my ISP to my localhost and not default IP: 127.0.0.1. I have apache server installed in my personal computer and want these settings locally.

  2. #2
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    Does your ISP allow you to host web sites from your connection?
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  3. #3
    SitePoint Enthusiast
    Join Date
    Jul 2011
    Posts
    62
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I just want to run a test program from my localhost. I always get 127.0.0.1 when i try by $_SERVER['HTTP_CLIENT_IP'] or $_SERVER['REMOTE_ADDR'] or $_SERVER['HTTP_X_FORWARDED_FOR'] locally.

  4. #4
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    Forget HTTP_CLIENT_IP and HTTP_X_FORWARDED_FOR. Those are not to be used under any circumstance.
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  5. #5
    SitePoint Enthusiast
    Join Date
    Jul 2011
    Posts
    62
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    REMOTE_ADDR also give me same localhost IP 127.0.0.1 how can i get my client / network IP which i get by whatismyip.com?

  6. #6
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    You have to travel from the outside in. Or just use your Private IP (normally 192.168.1.xxx) from your your own network. But the end result will still be the same. REMOTE_ADDR contains the IP of the connecting client. But HTTP_CLIENT_IP and HTTP_X_FORWARDED_FOR DO NOT, they can contain bad things.
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.



Bookmarks

Posting Permissions

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