|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Transforming php management site onto mobile phone
ok, I have a management site built in php and want to take some of that functionality onto a mobile phone. There is a login - then a search facility - then a results list - then a customer screen.
This is basic representation of the management site, there are lots of other bits, but this is pretty much what I want to appear. I was wondering if there was a way to see whether the user is accessing the site via a computer or a mobile device, then I can do a simple if(){ and only output the content that I want the mobile user to see. |
|
#2
|
||||
|
||||
|
Hi,
Of course it is possible. This thread points to a couple of methods. The very basic idea would be something like the following ...... Create a text file with all know mobile devices' user agent strings in it (first 4 characters) ... Code:
known devices sample
alav alca armv au-m then check the UA string. PHP Code:
So there you have it, if the $_SERVER['HTTP_USER_AGENT'] is in the list of known devices: $is_mobi returns true. Render content accordingly. Are you using a pre-made CMS or self developed? Joomla has something already that you can plug-in. Drupal will have soon ![]()
__________________
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 __________________ 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. ![]() __________________ |
|
#3
|
||||
|
||||
|
the other options would include:
running some kind of tests against the content-accept variables to check for xhtml-mp, html, wml, chtml etc and also check the browser isn't IE or FF etc - only serve wml etc to devices which support it yet are not full blown web browsers. you could also use the wurfl with wall4php then you would be able to show specific content for mobile devices as well as desktop, the wurlf though can be a tricky beast, can get it wrong and mess up so maybe a combination of the three suggestions would give you something much more solid than just any one part.
__________________
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 |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Mobile Programming > Transforming php management site onto mobile phone |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|