28-Dec-2008: Sounds very odd -- detect_mobile.php should only have 54 lines. Some of the lines are long -- did you open the file in a text editor that might have auto-wrapped them? DaveG

28-Dec-2008: Yes, I did open it in a text editor, which I do with all recipes just to check the code. However, I did not "save" the document so it shouldn't have been changed at all.

UPDATE: 20081230 - Dave, I tried it again using only command line tools to download, unpack, and setup the local config.php file and it's no longer yielding any errors. However, the recipe works fine on my website from a desktop computer, but doesn't switch skins when viewed on my mobile phone. I think the reason for this is that the mobile phone I have, Sidekick LX, uses the following user agent string:

Mozilla/5.0 (Danger hiptop 2.0; U; AvantGo 3.2)

I think the recipe is seeing that user agent string as 'mozi' which is also used in the Firefox web browser for desktop environments, thus the skin switch isn't happening. Is there a way to detect the "AvantGo" or "hiptop" bits of the above user agent string? I think that would help a great deal for Sidekick, Sidekick Color, Sidekick2, Sidekick3, Sidekick Slide, Sidekick LX, and Sidekick08 users. I'm planning to switch phones in the next few months to the T-Mobile G1 and the user agent string for that phone is:

But, being a Linux user myself, the best way to detect that user agent string is to detect either "Android" or "Mobile" as anything else will likely see browsers used under the desktop Linux OS as mobile when they aren't. Ian MacGregor

30-Dec-2008: I'll take a look tonight. I haven't updated the script for a while, so there's probably a few new browser types to add. DaveG

30-Dec-2008: I've upgraded the code. I can't perform an actual test, but the upgrade should accommodate the agent strings you've listed above. Let me know how it goes. Enjoy that G1 :) DaveG

This recipe is now working perfectly for me. Thank you for the update. Ian MacGregor