-1

Can .exe file runs From linux server to Windows client.. take a look at this :

$command = '../views/macaddress/macaddress.exe';
exec( $command, &$output);
var_dump($output,$dir);

when i run this on windows the output of var_dump is

array(0){   }

please anyone help me. im begging you.. its about a week ago when i started this.

BTW, this exe file.will generate txt file. and have the mac address on it.. thanks..

  • 1
    What are you trying to do? Please explain the purpose of what you are trying to do (and don't lie). – L0j1k Feb 28 '13 at 03:35
  • What did you expect to be in the var_dump? – FoolishSeth Feb 28 '13 at 03:37
  • You've asked about half-a-dozen questions related to getting MAC addresses. I'm still unclear as to ***why*** you're trying to get the MAC address of a device and ***which*** device's MAC address(es) you're looking for. This looks a lot like [an XY Problem](http://meta.stackexchange.com/q/66377/147331). – johnsyweb Feb 28 '13 at 04:29

2 Answers2

2

PHP is being executed server-side, so it does not have any access to the client's computer. Furthermore, it would be a major security issue if any website could run an exe on an innocent client's computer.

You will need to acquire users' mac addresses using client-side means that the user allows to run.

FThompson
  • 28,352
  • 13
  • 60
  • 93
0

bljak windows

but its not possible to take the clinent macaddress to do that you need some java applet to take it and send to you

anyay maybe you want server mac-address this sis the way

$ipconfiguration= exec('ifconfig');

you shoud get

eth0 Link encap:Ethernet HWaddr 00:23:13:55:79:78
inet addr:xxx.xxx.xxx.xxx Bcast:xxx.xxx.xxx.xxx Mask:xxx.xxx.xxx.xxx inet6 addr:xxx.xxx.xxx.xxx:7978/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:2 errors:0 dropped:0 overruns:0 frame:0 TX packets:2 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:2 (2.1 GiB) TX bytes:232330926 (1.6 GiB) Interrupt:23 Memory:fc300000-fc1300

so HWaddr 00:23:13:55:79:78 is the mac address

ddjikic
  • 1,254
  • 12
  • 28