|
-
Apr 25th, 2006, 07:18 PM
#1
Thread Starter
Member
-
Apr 25th, 2006, 08:48 PM
#2
Re: How to get MAC Address wtih PHP 5 ?
You can get the remote IP, which is pretty standard, as far as I know you cannot get a MAC address by TCP/IP as it is a local network thing rather than for interweb usage
PHP Code:
$user_ip = $_SERVER['REMOTE_ADDR'];
-
Apr 25th, 2006, 10:25 PM
#3
Thread Starter
Member
Re: How to get MAC Address wtih PHP 5 ?
I only want to use it in my office.
Is there any solutions to get MAC Address for remote computer ???
Because i need it...
-
Apr 25th, 2006, 10:40 PM
#4
Re: How to get MAC Address wtih PHP 5 ?
 Originally Posted by Lightzero
I only want to use it in my office.
Is there any solutions to get MAC Address for remote computer ???
Because i need it...
Why would you need something like this in a web solution? You might want to re-think your design.
What technology do you have at your disposal?
Since your Mac address is not transmitted via TCP/IP, there is no possible way to get the Mac addresses of any client with only PHP.
-
Apr 25th, 2006, 11:59 PM
#5
Thread Starter
Member
Re: How to get MAC Address wtih PHP 5 ?
OK. How about my local computer ??
Is it possible if i get my MAC Address with PHP on my local computer... ?
Thank you for your help...
-
Apr 26th, 2006, 12:02 AM
#6
Re: How to get MAC Address wtih PHP 5 ?
No, because PHP does not run on a local computer. PHP runs through a web server, whether its on the same computer or a remote computer it is always going to behave as if it is on a remote computer.
Basically, there is no way to get a MAC address. What do you need it for?
-
Apr 26th, 2006, 12:24 AM
#7
Thread Starter
Member
Re: How to get MAC Address wtih PHP 5 ?
For security in my php project...(I think i can use IP and MAC Address for my security like login system)
Thank You...
-
Apr 26th, 2006, 12:30 AM
#8
Re: How to get MAC Address wtih PHP 5 ?
If you can expand on "security" then I can help more. Security as in what? Authentication?
-
Apr 26th, 2006, 12:38 AM
#9
Thread Starter
Member
Re: How to get MAC Address wtih PHP 5 ?
-
Apr 26th, 2006, 12:40 AM
#10
Re: How to get MAC Address wtih PHP 5 ?
Well, usually one just uses a username/password combo, you could combine that with an IP also if they are static (should work on a local network) ?
-
Apr 26th, 2006, 02:03 AM
#11
Re: How to get MAC Address wtih PHP 5 ?
The MAC address is datalink level address used by protocols such as Ethernet and PPP to determine where to send datagrams. An IP datagram may pass through several of these networks as it is routed through the Internet and each time it is, it is re-addressed with the MAC addresses of the devices it travels between.
By the time you get the data to your web server the only MAC address it will have is that of router, switch or modem the web server is connected to. In other words it is impossible (unless you run an application on the client computer), to get the MAC address of the device sending the data.
What level of security do you need? There are a number of measures you can take to prevent session hijack, including username and password authentication, timeout policies, Javascript hashing and encrpytion and the most secure of all which provides, encryption and verification of identity at both endpoints is SSL.
-
Apr 26th, 2006, 07:33 PM
#12
Thread Starter
Member
-
Dec 10th, 2010, 01:18 PM
#13
Hyperactive Member
Re: How to get MAC Address wtih PHP 5 ?
Please try this and let me know if there is an issue.
PHP Code:
function getMac(){
exec("ipconfig /all", $output);
foreach($output as $line){
if (preg_match("/(.*)Physical Address(.*)/", $line)){
$mac = $line;
$mac = str_replace("Physical Address. . . . . . . . . :","",$mac);
}
}
return $mac;
}
$mac = getMac();
$mac = trim($mac);
-
Dec 11th, 2010, 07:59 PM
#14
Re: How to get MAC Address wtih PHP 5 ?
1. This thread is over four years old.
2. The original question was about getting the MAC address of the client. Your code will return the MAC address of the server, and only if it's running Windows.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|