ronin - 12:07 pm on Feb 5, 2013 (gmt 0) [edited by: martinibuster at 9:26 pm (utc) on Feb 5, 2013]
I have been using a PHP server-side solution on my mobile site.
Basically, I wanted the server to detect whether the site was about to display on a mobile device or a desktop/laptop computer and display the appropriate Adsense leaderboard just below the page navigation bar.
I found Danny Herran's detect_mobile() function ideal for this purpose.
(See: http://www.dannyherran.com/2011/02/detect-mobile-browseruser-agent-with-php-ipad-iphone-blackberry-and-others/ [dannyherran.com] )
I include the detect_mobile() at the top of the page and it either returns $mobile = 1 or $mobile = 0.
If $mobile = 0, the 728x90 Adsense Leaderboard displays.
If $mobile = 1, the 320x50 Adsense Mobile Leaderboard displays.
[edit reason] Fixed link. If it's useful & Non-Promo I'm ok with it. [/edit]
[edited by: martinibuster at 9:26 pm (utc) on Feb 5, 2013]