Solved

Show clients IP address or mac address on web page

Posted on 2014-11-16
11
129 Views
Last Modified: 2014-12-28
I need to able to display the users IP Address or preferably the mac address on a web page which will also be submitted along with other info for registration purposes. I did this A while back and I believe it was with ASP but can not remember the procedure. Thanks for any help.
0
Comment
Question by:ChuckT
11 Comments
 
LVL 3

Expert Comment

by:Richard Obenchain
Comment Utility
You can use request server variables (in ASP, it is "Request.ServerVariables["REMOTE_ADDR"]") to get the IP of the remote machine, but unless it's on a local network where you can use ARP to look up the MAC, you're not going to get a MAC without running some kind of client-side app (java or something).
0
 
LVL 82

Expert Comment

by:Dave Baldwin
Comment Utility
If this is on a publicly accessible web page on the internet, you will only get the public IP address.  If the client is on a LAN that connects to the internet thru a router and/or modem, you will not see their LAN IP address.  And if there is more than one computer on that LAN, all the computers will appear to have the same IP address which will be the public IP address.  In that case it will Not be a unique identifier.
0
 

Author Comment

by:ChuckT
Comment Utility
clients are on the same subnet as the webserver. I put that exactly as you put it but it shows on the page as well as in the code. Not working. What am I missing.
0
 
LVL 82

Expert Comment

by:Dave Baldwin
Comment Utility
Did you name the file "*.asp" so the ASP interpreter will run it?
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:ChuckT
Comment Utility
yes I put it in my existing asp file which send the Users name and email address to me.
0
 
LVL 82

Accepted Solution

by:
Dave Baldwin earned 500 total points
Comment Utility
While I'm sure that it is available, you can run this short program that displays all of the available server variables.  Note the use of 'Response.Write' to get them to show on the page.
<%@ LANGUAGE = VBScript %>
<%  Option Explicit		%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<title>ASP Server Variables</title>
</head>
<body>
<h1>ASP Server Variables</h1>
<%
Dim item

For each item in Request.ServerVariables
	Response.Write "<b>" & item & "</b>: " _
	& Request.ServerVariables(item) _
	& "<br>" & vbCrLf
Next

	Response.Write "<b>PATH_INFO</b>: " _
	& Request.ServerVariables("PATH_INFO") _
	& "<br>" & vbCrLf

%>

</body>
</html>

Open in new window

0
 
LVL 58

Expert Comment

by:Gary
Comment Utility
I've requested that this question be deleted for the following reason:

Not enough information to confirm an answer.
0
 

Author Comment

by:ChuckT
Comment Utility
Solutions were accepted a while back . why does this still show as open.
0
 
LVL 82

Expert Comment

by:Dave Baldwin
Comment Utility
Thanks for the points!!
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
In this article you will learn how to create a free basic website on Bitbucket, a git service provider. Polymer creates dynamic HTML components, which allow more flexibility than static HTML. This tutorial uses Ubuntu Linux but can also be done on W…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

772 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