Solved

getting IP address

Posted on 2002-04-24
10
173 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
ID: 6966913
0
 

Author Comment

by:tomhoran
ID: 6967175
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
ID: 6969439
<%
' RETURNS THE REQUESTER IP TO anyVariable
userIPAddress = Request.ServerVariables("REMOTE_ADDR")
%>
0
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
LVL 19

Expert Comment

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

CJ
0
 

Author Comment

by:tomhoran
ID: 6969637
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
 
LVL 19

Expert Comment

by:cheekycj
ID: 6969664
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
ID: 6969679
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
ID: 6969726
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
ID: 8187080
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
ID: 8240142
As recommended

Chmod
Community Support Moderator @Experts Exchange
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When deciding to adopt any help desk solutions many factors should be explored before taking decisions. This will change from business to another but in general there are some kind of rule of thumb. Here are some quick tips: Do we need only ticket…
This guide will walk you through the essential considerations and tech stack for building scalable websites. Know how to grow your business the smart way!
The purpose of this video is to demonstrate how to properly insert a Vimeo Video into a WordPress site or Blog. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp…
The purpose of this video is to demonstrate how to insert an Iframe into WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Open Page or Post…

831 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