Solved

getting IP address

Posted on 2002-04-24
10
170 Views
Last Modified: 2010-05-18
how can I get the IP address for the server who is accessing my site.

I want to allow a customer access to my website, but want to limit access to certain customers. I was looking at the http header trying to get the ip address but all I get is my address.

my setup;

I'm using II's and using ASP pages. I'm using the "Request.ServerVariables".

suggestions?
0
Comment
Question by:tomhoran
10 Comments
 
LVL 4

Expert Comment

by:EricWestbo
Comment Utility
0
 

Author Comment

by:tomhoran
Comment Utility
i'm running nt 4. i have loggin enabled. i want to be able to access the IP address in my asp page on a real-time basis.
0
 
LVL 19

Expert Comment

by:cheekycj
Comment Utility
<%
' RETURNS THE REQUESTER IP TO anyVariable
userIPAddress = Request.ServerVariables("REMOTE_ADDR")
%>
0
 
LVL 19

Expert Comment

by:cheekycj
Comment Utility
you can use REMOTE_HOST for the server name of that IP address.

CJ
0
 

Author Comment

by:tomhoran
Comment Utility
i've used all of the following:

hostall = Request.ServerVariables("ALL_HTTP")
securelogin = Request.ServerVariables("HTTPS")
hostaddr = Request.ServerVariables("HTTP_HOST")
hostip = Request.ServerVariables("REMOTE_ADDR")
referer = Request.ServerVariables("HTTP_REFERER")
REMOTEHOST = Request.ServerVariables("REMOTE_HOST")

they all return the values from my router and not the webiste i came from. the only one that returns a value from the initiating website is HTTP_REFERER.

see www.bensoftinc.com/wk1.htm (this site is hosted by Dell). then click on the link "login to repayme". this will take you to my other website, hosted here in the office.

suggestions?
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 19

Expert Comment

by:cheekycj
Comment Utility
this tells the you the IP address of the requesting server/client.. your router's IP address should NOT be involved.

referrer is just the server name the request came from (like what page you clicked the link from)

do you want the client's IP address or the server that sent the client to you?

CJ
0
 

Author Comment

by:tomhoran
Comment Utility
i'm looking for the server that sent the client to me. what i'm looking to do is allow certain customers to auto login from there website (since hey have already verified the login), so i want to verify who is trying to autologin. I can use the referrer as that has the webaddress it's coming from but one client was having a problem sending it to me (they are linx/appache)
0
 
LVL 19

Accepted Solution

by:
cheekycj earned 80 total points
Comment Utility
then HTTP_REFERRER is what you want.

You want to verify that the cleint came from this server to you only.

CJ
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
Comment Utility
It is time to clean this abandoned question up.  

I am putting it on a clean up list for CS.

<recommendation>
points to cheekycj

</recommendation>

If anyone participating in the Q disagrees with the recommendation,
please leave a comment for the mods.

Cd&
0
 

Expert Comment

by:Chmod
Comment Utility
As recommended

Chmod
Community Support Moderator @Experts Exchange
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

This article provides a case study on how our local youth baseball league deployed a new website, including the platform selection, implementation and benefits to the league.
Objective of This Article In 1990’s, when I was a budding software professional, I had a lot of confusion about which stream or technology, I had to choose to build my career. In those days, I had lot of confusion like whether to choose System so…
The purpose of this video is to demonstrate how to integrate Mailchimp with WordPress, by placing a Mailchimp signup form on a WordPress Page or Post. This will be demonstrated using a Windows 8 PC. Mailchimp will be used. Log into your Mailchi…
The purpose of this video is to demonstrate how to prevent comment spam on a WordPress Website. This will be demonstrated using a Windows 8 PC. Plugin Akismet will be used. Go to your WordPress login page. This will look like the following: myw…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now