PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Sun Feb 23, 2020 3:23 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Sun Oct 23, 2011 6:10 pm 
Offline
Forum Contributor

Joined: Sat Oct 22, 2011 10:50 am
Posts: 159
Hello,

I'm looking for a viable way of coding some PHP that inserts the users MAC address into my MySQL table when a request is sent (form submission). I know that PHP is server-side scripting and all, but it must be possible; surely?

Why I need to do this is because, so far I've been logging the IP when a request is sent so that I can track the usage of individuals (I don't need their identity) just to track if it's the same device making requests. But the project is targeted at mobile devices, so the IP addresses are changing quite frequently so I'm finding that I can't accurately track usage. If anybody can suggest a better way of overcoming this, without using the device's MAC address then please feel free to leave comments! :)




Thanks in advance,
Mike.


Top
 Profile  
 
PostPosted: Tue Oct 25, 2011 1:21 am 
Offline
DevNet Resident
User avatar

Joined: Sun Sep 03, 2006 5:19 am
Posts: 1579
Location: Sofia, Bulgaria
You can't get the MAC address without client-side code (read: browser plugin)
There are other ways to identify users: cookies for example.


Top
 Profile  
 
PostPosted: Tue Oct 25, 2011 4:04 am 
Offline
Forum Contributor

Joined: Sat Oct 22, 2011 10:50 am
Posts: 159
Could this perhaps be processed by some sort of Javascript and then passed as a variable? I wanted to steer away from using Cookies really as they can be cleared, then I'll again get duplicated values. Actually thinking on .. I might look into having some Javascript get the MAC address, store it as a cookie, and then have the PHP read the cookie. That way it'll never change.


Top
 Profile  
 
PostPosted: Tue Oct 25, 2011 4:22 am 
Offline
Site Administrator
User avatar

Joined: Sun May 19, 2002 10:24 pm
Posts: 6887
The MAC address can be spoofed.

_________________
Image


Top
 Profile  
 
PostPosted: Tue Oct 25, 2011 5:32 am 
Offline
Forum Contributor

Joined: Sat Oct 22, 2011 10:50 am
Posts: 159


Top
 Profile  
 
PostPosted: Tue Oct 25, 2011 7:51 am 
Offline
DevNet Resident

Joined: Sun Jun 14, 2009 3:13 pm
Posts: 1146


Top
 Profile  
 
PostPosted: Tue Oct 25, 2011 10:15 am 
Offline
Briney Mod
User avatar

Joined: Mon Jan 19, 2004 7:11 pm
Posts: 6446
Location: 53.01N x 112.48W
The MAC address isn't accessible by Javascript. On the iPhone you're going to have pretty much zero opportunity to access the MAC address via a website. You should stop trying to build a system that requires the user not do something, and instead build it so it's flexible enough to recover when they inevitably do.

_________________
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.


Top
 Profile  
 
PostPosted: Wed Oct 26, 2011 3:54 pm 
Offline
DevNet Master
User avatar

Joined: Wed Jun 27, 2007 9:44 am
Posts: 4313
Location: Sofia, Bulgaria
Closely related discussions here:

viewtopic.php?f=6&t=89514
viewtopic.php?f=19&t=104832

_________________
There are 10 types of people in this world, those who understand binary and those who don't


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group