php question
- Started
- Last post
- 8 Responses
- attentionspan
So, i have a link on a site that the user is directed to after scanning a QR code.
Is there a script that can detect which phone you have?
Heres an example:
scan with iphone > go to example.com/phone > then user gets redirected to appstore
scan with android > go to example.com/phone > then user gets redirected to android market
Thanks
- detritus0
you piqued my curioisty and with a wee bit of googling, I happened upon this.. http://deviceatlas.com/
Seems like PHP/JS solutions can derive browsers easily enough, roughly conforming to platform, but not absolutely.
*shrugs*
I'm ignorant of this sphere though - I have to convert a couple of sites to mobile readiness in the near future :\
- Mind you, from the clip art alone I'd steer well clear of that site.detritus
- :)detritus
- haha fucking awesome highly polished looking corporate douchbagsattentionspan
- attentionspan0
think i found something
detectmobilebrowsers.mobi/
- orrinward20
userAgent should handle this.
It may not be 100%, but Apple uses Mobile Safari right? Which is not available on Android?
If device isn't detected, then you may run into problems with Mobile Opera if you can get it on iPhone.
- BattleAxe0
use this script at the top of the page that gets linked to.
so qr tag goes to detect.php with the php code from this site
http://www.kevinleary.net/mobile…
then in each condition put a new header redirect to each systems specific page
ie
if( stristr($_SERVER['HTTP_USER_AGEN... ) {
$device = "ipad";
header('Location: http://www.example.com/');
}
- attentionspan0
thanks guys - works