|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today! |
|
#1
|
||||
|
||||
|
Quicker / more effective moblie device detection script
Hi,
Not sure whether I should have posted this in the PHP forum or not, but thought I would try here first. What I want to do it detect whether a user is on a PDA / phone or on a web browser to browse HTML pages. I have been playing around with some scripts but would like to have comments on a more effective way. I was thinking of additional stuff if it was a WAP browser, but just going for the (x)html first ![]() PHP Code:
Basically it loops though a text file and if it returns true at all, it prints proper browser. So is there a better way? I have attached teh browser list text that the script it reading. I have also included the current script that I have running to redirect to a wap site, but doesn't seem to work too well, so any comments on that much appreciated. Thanks in advance..
__________________
Cheers, Jamie # skiFFie | Home of the 'accessibility module' for Drupal # Jamie Burns [me] Accessibility Module [drupal] # guidelines | search | wap resources | not getting help | fold to cure # Any form of employment is strictly prohibited ...... __________________ Let the might of your compassion arise to bring a quick end to the flowing stream of the blood and tears ..... Please hear my anguished words of truth. __________________ |
|
#2
|
||||
|
||||
|
Hi Jamie,
Your live index is from the same script I used on some of our wap sites, it seemed to do the trick most of the time but I modded ours to include more user agents then the default came with. Having more agents makes it more stable but I dumped it in the end. PHP Code:
In fact thinking about that list makes me realise how out of date that code snippet is, If I was still using it I'd prolly butcher it to eregi up.link as a match and add the other agents too in the hope it makes it more stable. HTH
__________________
Andy Moore << oh no it's got a blog..... Word Press WAP Plugin with Ad Mob Advertising revenue PHP developer deploying ringtones, mp3 downloads and realtones I'm a geek who's obsessed with stats and gadgets |
|
#3
|
||||
|
||||
|
Hi Andy,
Thanks for the info. I have actually modded my script a bit (now at work so no access to it). Will play around some more when I get home. Jamie |
|
#4
|
|||
|
|||
|
your wap agent strings
Quote:
Hi - took me a while to work out what you meant by eregi the Up.link but i've got it after looking at your browser string list - quick question though - what is the significance of the Up.link? appreciate your help tommy |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > WAP Programming > Quicker / more effective moblie device detection script |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|