Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Show clients IP address or mac address on web page

Posted on 2014-11-16
11
Medium Priority
?
169 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
ID: 40446174
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 84

Expert Comment

by:Dave Baldwin
ID: 40446209
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
ID: 40446281
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
Cyber Threats to Small Businesses (Part 1)

This past May, Webroot surveyed more than 600 IT decision-makers at medium-sized companies to see how these small businesses perceived new threats facing their organizations.  Read what Webroot CISO, Gary Hayslip, has to say about the survey in part 1 of this 2-part blog series.

 
LVL 84

Expert Comment

by:Dave Baldwin
ID: 40446291
Did you name the file "*.asp" so the ASP interpreter will run it?
0
 

Author Comment

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

Accepted Solution

by:
Dave Baldwin earned 2000 total points
ID: 40446323
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
ID: 40521214
I've requested that this question be deleted for the following reason:

Not enough information to confirm an answer.
0
 

Author Comment

by:ChuckT
ID: 40521210
Solutions were accepted a while back . why does this still show as open.
0
 
LVL 84

Expert Comment

by:Dave Baldwin
ID: 40521225
Thanks for the points!!
0

Featured Post

When ransomware hits your clients, what do you do?

MSPs: Endpoint security isn’t enough to prevent ransomware.
As the impact and severity of crypto ransomware attacks has grown, Webroot has fought back, not just by building a next-gen endpoint solution capable of preventing ransomware attacks but also by being a thought leader.

Question has a verified solution.

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

I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
In order to have all security and back ups taken care of, WordPress users can sign up for services with WP Engine.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

926 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