Using just PHP, is there anyway to detect if the page is being loaded from a SPECIFIC device? Say, I would want the page to react differently if only MY iPhone was loading the page, no one else's?
The only solution I have so far is to use $_SERVER['REMOTE_PORT' in conjunction with $_SERVER['HTTP_USER_AGENT'], to verify iPhone, but that doesn't ensure a specific iPhone..
Navigate to the app > res > layout > activity_main. xml and add the below code to that file. Below is the code for the activity_main. xml file.
A Public IP is given to your internet gateway (router) by your ISP. All devices on your network are using the same Public address but different Private ones. Your ISP or police with a warrant can use your Public IP to find the internet account holder but may not be able to find the individual device owner.
Yes. To do so, you need to open a Command Prompt window and enter the command “arp -a”. That way you will get all of the IP addresses that are active on your network. You will get a list with the physical address, which is the MAC address and the corresponding IP address.
There is a really simple solution to use Mobile-detect here: https://github.com/serbanghita/Mobile-Detect/
Enjoy!
$_SERVER['HTTP_USER_AGENT'] contains information about the browser and the device used. So if you know the User Agent - sent by your device - then you can quite easily write an if statement, that will see if it's the one you want or not.
However, usually you don't really want to play with manual aiming at the devices, especially when it comes down to mobiles. Think about using something like wurfl, a class that allows you to determine a type of device that loaded your webpage.
If you want to aim at specific iPhone you'd most likely want to compare it's user agent with user agent of another model. But as far as I know - it's very flawed method, and doesn't really work in a long term. So long answer short: There's no way to aim at very one specific iPhone model (because any of them sends roughly identical data to the server if they all got same iOS and same browser).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With