Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 348007
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T11:19:28+00:00 2026-05-12T11:19:28+00:00

I am trying to grab a users’ IP address to show them content relevant

  • 0

I am trying to grab a users’ IP address to show them content relevant to their geography. I used the php code $ip = getenv(‘REMOTE_ADDR’); to grab their IP address. This works fine on my computer but my co-developer tried it and found that he was unable to connect to our site at all and got a “Host Not Accessible” error. He is unable to connect to our site via FTP as well or from another computer at his house.

I took out this code and he still couldn’t connect (but could using a proxy). I am wondering why this code would have these side effects. Is $_SERVER(‘REMOTE_ADDR’). Whats the best way to grab a user’s IP address in PHP?

Thanks

Russ

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T11:19:28+00:00Added an answer on May 12, 2026 at 11:19 am
    1. That code doesn’t have side effects. The problem your coworker is seeing is more likely a firewall/connectivity/server configuration issue.
    2. Using $_SERVER is indeed the proper way to get those variables’ values.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use UIImagePickerController to grab a photo from the users Photos on
Im trying to grab the destination (dynamic) of a link (static) with php Im
I'm trying to grab post counts from a users on a forum. if (td[i].innerHTML.match(Posts:
I'm trying to build a safe user authentication system. The code is from http://net.tutsplus.com/tutorials/php/simple-techniques-to-lock-down-your-website/
I am trying to find a way to retrieve a users zip code based
I'm trying to grab all users joined with Company var users = CreateObject<User>(); var
I'm trying to make my application grab a photo from the user's Photo library
Trying to grab the numbers in front of (h), (w) and (d). These are
Im trying to grab the title on the <li> when it is clicked. It
Hi I am trying to grab a div from another website using JS. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.