Wrox Programmer Forums
|
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 28th, 2009, 11:20 PM
Authorized User
 
Join Date: Jan 2009
Posts: 16
Thanks: 1
Thanked 0 Times in 0 Posts
Default MAC address

Hi,

How can i get mac address of a remote system, if so could you please send the code.
__________________
divinequran.com
 
Old March 4th, 2009, 11:15 PM
Authorized User
 
Join Date: Jan 2009
Posts: 16
Thanks: 1
Thanked 0 Times in 0 Posts
Default

i am able to get my server information using exec, is there is any option to get my clients IP address.
__________________
divinequran.com
 
Old March 5th, 2009, 05:39 AM
Authorized User
 
Join Date: Feb 2009
Posts: 16
Thanks: 0
Thanked 1 Time in 1 Post
Default

Use can use the server variable called REMOTE_ADDR to get the IP address in PHP

PHP Code:
echo $_SERVER['REMOTE_ADDR']; 
Regards
Anees
 
Old March 6th, 2009, 01:31 PM
Authorized User
 
Join Date: Jan 2009
Posts: 16
Thanks: 1
Thanked 0 Times in 0 Posts
Default

i am able to get my server information using exec, is there is any option to get my clients MAC address.
__________________
divinequran.com
 
Old March 7th, 2009, 02:29 AM
Authorized User
 
Join Date: Feb 2009
Posts: 16
Thanks: 0
Thanked 1 Time in 1 Post
Default

i Got this snippet from Web

PHP Code:
/*
*   Getting MAC Address using PHP
*   Md. Nazmul Basher
*/
 
ob_start();    // Turn on output buffering
system(’ipconfig /all’);  //Execute external program to display output
$mycom=ob_get_contents(); // Capture the output into a variable
ob_clean();  // Clean (erase) the output buffer
 
$findme   = “Physical”;
$pmac strpos($mycom$findme); // Find the position of Physical text
$mac=substr($mycom,($pmac+36),17); // Get Physical Address
 
echo $mac
http://nazmulb.wordpress.com/2008/07...ess-using-php/


Try it and share your experience

Another method is using javascript
But that only works in IE by the help of ActiveX Objects

http://www.qualitycodes.com/tutorial.php?articleid=19

Regards
Anees

Last edited by anees_muhd; March 7th, 2009 at 02:32 AM..
 
Old March 16th, 2009, 10:25 PM
Authorized User
 
Join Date: Jan 2009
Posts: 16
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Thanks for your reply, Can i get mac address of my client's machine who ever visits my website
__________________
divinequran.com
 
Old March 17th, 2009, 09:20 AM
Friend of Wrox
 
Join Date: Sep 2005
Posts: 166
Thanks: 2
Thanked 33 Times in 33 Posts
Default

In a word - no. The best you can do is their IP Address as shown by anees.
You could use the ActiveX control suggested, but that would probably not be too popular on a public website.

Phil

Last edited by philip_cole; March 17th, 2009 at 09:23 AM..





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to get Client's MAC Address! mutinousguy ASP.NET 2.0 Professional 0 September 27th, 2007 07:42 PM
How to get MAC K Address msbsam ASP.NET 2.0 Basics 2 July 10th, 2007 06:36 AM
Getting the MAC Address mswombat Classic ASP Basics 0 June 3rd, 2006 11:45 AM
How to scan all Mac address in my network? cl408e C# 0 May 5th, 2006 05:12 AM
how to find mac address of my client...? abdusalam Pro VB.NET 2002/2003 1 August 3rd, 2004 03:59 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.