PHP - How Adding MAC Address to User-Agent Code ?

Asked By Vera Onas on 18-Jun-12 09:19 AM
Hi,

How can I add Mac Adress to this Code ?


if (strpos($_SERVER['HTTP_USER_AGENT'], 'iPad') !== FALSE) {

Thanks
Super Man replied to Vera Onas on 27-Jun-12 12:50 PM

If you won’t to change the user agent string which will be sent when you are browsing, you can change it from the Registry. You can see this and add manually MAC ID information.

http://www.pctools.com/guides/registry/detail/799/


And if you want to get MAC ID information of the user’s PC, then you can not do from PHP website..

Vera Onas replied to Super Man on 29-Jun-12 08:05 AM
Thank you for your answer.

I have a private URLs , and i habe use User Agent for connection this URLs.

if (strpos($_SERVER['HTTP_USER_AGENT'], 'Mozilla/5.0') !== FALSE) {

But now I do not want visitors , I want to connect only certain MAC addresses.

Can i add my Mac Adress to User Agent Code ?

example

for this code, I would like to use User Agent with Mac Address together

<?
$mac
= substr($_SERVER['HTTP_USER_AGENT'], strpos($_SERVER['HTTP_USER_AGENT'],"mac_addr=XXXXXXXX")
;
echo
$mac
;
?>
Super Man replied to Vera Onas on 29-Jun-12 12:27 PM
 " I want to connect only certain MAC addresses "


I assume, It means you are having limited people access to your site ( For ex. employee )

But from the website, you can not access MAC Address of any PC. ( otherwise it will be question on Security of Browsers ).

If you want to share it among only few peoples. you have to manually set MAC ID in their UserAgent String. But malicious user can gain access to your site just changing its own user-agent to specific & similar to your  MAC ID.

Better to run on it on IntraNet or using VPN.

Sorry if i am going far from your answer.
Vera Onas replied to Super Man on 30-Jun-12 09:00 AM
If you want to share it among only few peoples. you have to manually set MAC ID in their UserAgent String. But malicious user can gain access to your site just changing its own user-agent to specific & similar to your MAC ID.

You are right ...but still i wanna know how can I add manually Mac address to UserAgent Code ?

Thank You



Super Man replied to Vera Onas on 30-Jun-12 01:13 PM
For change in Useragent string of Mozilla browser:

Just get the IP of your client and add as in the User agent string as described below.:

How to edit the User Agent string

To change the User Agent string, just enter about:config as an address in the address bar of FireFox, the location where you normally enter a URL (link). I recommend to preserve the original value, which you can get when you enter just about: in the address bar.

Now press the right mouse button to get the context menu and select "String" from the menu entry "New". Enter the preference name "general.useragent.override", without the quotes. Next, enter the new User Agent value you want Mozilla Firefox to use.


second way:

Create one .Net application with browser control which opens your websites.
which also add mac  ID in the header. So you don't need to add it all your client PC manually.

Here i am providing two article for reference
1) How to get MAC ID in c#
http://stackoverflow.com/questions/850650/reliable-method-to-get-machines-mac-address-in-c-sharp

2) Just get Mac id and add it to the user agent string of browser control .
http://stackoverflow.com/questions/937573/changing-the-useragent-of-the-webbrowser-control-winforms-c-sharp

Vera Onas replied to Super Man on 24-Jul-12 06:19 AM
Thank you Super Man

may I ask you something my msn by private?
Super Man replied to Vera Onas on 25-Jul-12 01:49 PM
give ne ur id
Vera Onas replied to Super Man on 25-Jul-12 02:34 PM
chromos@hotmail.de

This is my Msn ID.

Thank You Super Man
Vera Onas replied to Super Man on 27-Jul-12 07:15 AM
Hi Superman, if you have a time, I would like to ask a question, I still waiting.

Thank You

Super Man replied to Vera Onas on 27-Jul-12 11:09 AM
hello, i have sent an email already to that email. i am again sending requrst to that email id from my msn messenger. my email id starting with h.