Identify a mobile phone user using an http header in PHP - php

Kind of an odd question but still wanted to check.Is there a way in which I can uniquely identify a mobile phone user who has visited my website using the http header.Getting the mobile phone or IMEI of a user is an impossible thing , but is there any work around to identify a mobile phone user who visit my website or from the user agent details?
Any ideas?

I think not only php but combination with javascript will do the job. On page load you can get the screen width by using screen.width and then pass it to php file.
Hope it helps.

Related

Facebook click-id missing (fbclid)

I am currently running several ads on facebook and I have just started using the facebook-click-id to replace facebook-pixels for the tracking. For some reason I have found that there are a lot of clicks coming in through the ads without the fbclid-parameter attached to the url as a get-parameter.
Through a google search I have found out that the only reasons the fbclid-parameter would not be attached to the url would be that the user clicking on the ad is not logged in to facebook or that the user is using his/her browser with the incognito-mode activated.
It seems odd to me that so many clicks could happen under those circumstances. Which is why I am wondering if there are other reasons why the facebook-click-id (fbclid-parameter) would not be attached to the url.
Are there any other reasons why the fbclid-parameter would not be attached to the outgoing url of a facebook ad? Thanks!
after doing some tests trying to solve the same problem, what I noticed is that fbclid parameter did not appear in outbound links when using the browser built into the mobile Facebook app.
So, I think that this is a Facebook limitation.
Hope it helps,

make url should only work within the requested device

I have a very specific requirement, not sure this is possible or not.
I have a web page which should only accessible through a mobile app and also the url should only valid for that particular device. So that if someone share that link no one can access that page.
As an approach I used $_SERVER ['HTTP_USER_AGENT'] just to check whether the request is coming from the mobile device.(Still I couldn't identify whether the request is coming from the mobile app or mobile browser only )
Example:
requesting url : m.domain.com/page1/?device_id=xxxx
so when I process this url I need verify the device_id is the same one as it is in the query string.
Please note that I am using PHP as the programming language.
Any kind of a lead should be highly appreciating.
Thanks in advance.

Mobile App Unique ID detection in PHP

I'm building a mobile app which will call a search engine on my website. I have PHP code to detect if a person is coming in through a Mobile device. However, I want to see if I can detect if they are coming in through my app versus a regular page browse.
In the past, I've had a hidden field on a form submission, but this is not feasible anymore.
I want to know if there is a way if somebody accesses a page on my website through the mobile app or a mobile browser?
One option is to pass a PHP $_GET parameter, but I'm looking for other solutions.
Perhaps override the user agent used in the mobile app, or send an additional header that your PHP scripts can look for
You can modify the default user agent to identify your application.

iframes for ads? getting user information?

I was trying to do something like Google's Adsense. I believe they use javascript? But is using iFrame a good idea to have someone put on their site if they want to display ads? Would iFrames able to capture user's data information such as cookies (how adsense works, they get users cookies--that's why they can display ads of sites you've visited, correct me if I'm wrong)?
If this works, how would I able to get users cookies? Is it possible? How does google get users cookies?
Thanks for your help in advance!
(how adsense works, they get users cookies--that's why they can display ads of sites you've visited, correct me if I'm wrong)?
You are wrong. Google can only access Google's cookies. It's a big point in cookie security; no browser will allow you to get to other sites' cookies. Google can use cookies to identify you, but can't use them to see your behaviour on non-Google sites.
AdSense knows what you've been browsing by checking what links you click on Google Search and other services, what Ads you click on, what pages you visit that have AdSense in them (window.top.document.location) and which pages you visit them from (window.top.document.referrer), and probably more methods that people smarter than me at Google come up with :)
EDIT: as shown in comments, in fact one can't rely on top properties.
No you can't get these cookies. They're stored to be readable only by the domain AdSense uses to log people.
This is why an iframe is used, it allows google to load a specific url on a domain they control, the url contains an identifier telling them what AdSense campaign is being used.
Besides, the cookie which is present (but not accessible by you) doesn't contain any information about the user itself. It is instead just an identifier to link the person to data which is already present on the google servers.

Recognized devices system in php

Im making a social network and im trying to implement this feature where if the user is logged in from a different machine it will ask him to type in the password or identify his friends like in facebook.
I can do this using IP checks but that would be stupid if if the user had dynamic ip adress, then another option is cookies but that would also be stupid for many reasons - one being that its client side.
So then, i think mac address will be the thing to use, but i have no idea how to grab the mac address using php or javascript.
I think if this is possible, then it will be via js because it is client side
So any suggestions?
Why is it 'stupid' to use client-side information for authentication, that's where you'll be getting the username and password from and you're likely trusting that already
There is no way to grab the user's MAC address unless you're on the same network and the network allows such a lookup using ARP
You'll likely have to use cookies for this, and just make sure not to clear them if a particular browser is 'trusted'. If you think users are likely to share cookies with each other along with their username and password you could encode some other browser specific fields (exact UA header?) into the cookie to add more data you can use to decide if the client is trusted
That's more a comment than an answer:
Im making a social network and im trying to implement this feature where if the user is logged in from a different machine it will ask him to type in the password or identify his friends like in facebook.
I'm not the author of that feature from facebook, so I don't have the specification of that feature at hand. If you would be so kind and add the specification of the feature you ask a question about to your question, it's probably possible to answer your question profoundly.
I have come up with a solution
I can use this api http://ipinfodb.com/ip_location_api.php And grab the location of my users and if it changes ask them to verify device.

Categories