Solved

getting IP address

Posted on 2002-04-24
10
175 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

 
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

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

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

Suggested Solutions

Introduction In this tutorial, I'll explain how to create an animated progress meter in a wireframe prototype developed using Axure RP 7.0 - a leading prototyping tool for designing web sites and software. (For more information about Axure and gett…
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 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…

738 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