<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Detecting Mobile Browsers</title>
	<atom:link href="http://www.brainhandles.com/2007/10/15/detecting-mobile-browsers/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.brainhandles.com/2007/10/15/detecting-mobile-browsers/</link>
	<description>Whatever's tugging at my brain handles</description>
	<pubDate>Sat, 17 May 2008 04:25:20 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: Brandon Eley</title>
		<link>http://www.brainhandles.com/2007/10/15/detecting-mobile-browsers/#comment-6738</link>
		<dc:creator>Brandon Eley</dc:creator>
		<pubDate>Fri, 25 Apr 2008 18:53:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.brainhandles.com/2007/10/15/detecting-mobile-browsers/#comment-6738</guid>
		<description>It seems that the checkmobile function creates a false positive on AOL 10. I have the function exactly as you have it here, and it is returning true on the preg_match on the 'eric' user agent string.

In looking at the Sony/Ericsson user agents, I think changing it to 'erics' should work. Please let me know what you come up with also.</description>
		<content:encoded><![CDATA[<p>It seems that the checkmobile function creates a false positive on AOL 10. I have the function exactly as you have it here, and it is returning true on the preg_match on the 'eric' user agent string.</p>
<p>In looking at the Sony/Ericsson user agents, I think changing it to 'erics' should work. Please let me know what you come up with also.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Greg Harris</title>
		<link>http://www.brainhandles.com/2007/10/15/detecting-mobile-browsers/#comment-6566</link>
		<dc:creator>Greg Harris</dc:creator>
		<pubDate>Fri, 11 Apr 2008 22:22:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.brainhandles.com/2007/10/15/detecting-mobile-browsers/#comment-6566</guid>
		<description>Awesome!

I just created a SQL Server function using C# and .NET to build a pre-screener before we hit WURFL and other device databases. This post directly influenced the final code. Thanks for the ideas! I can now do this right in a database query, thousands of user-agents in seconds.

Thanks!

Greg Harris
http://www.mobilytics.net</description>
		<content:encoded><![CDATA[<p>Awesome!</p>
<p>I just created a SQL Server function using C# and .NET to build a pre-screener before we hit WURFL and other device databases. This post directly influenced the final code. Thanks for the ideas! I can now do this right in a database query, thousands of user-agents in seconds.</p>
<p>Thanks!</p>
<p>Greg Harris<br />
<a href="http://www.mobilytics.net" rel="nofollow">http://www.mobilytics.net</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kier</title>
		<link>http://www.brainhandles.com/2007/10/15/detecting-mobile-browsers/#comment-6365</link>
		<dc:creator>kier</dc:creator>
		<pubDate>Fri, 07 Mar 2008 10:41:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.brainhandles.com/2007/10/15/detecting-mobile-browsers/#comment-6365</guid>
		<description>Larry,

detection for browsers in ASP(VBScript):

&#60;%
str = Request.ServerVariables("http_user_agent")
	if InStr(1, str, "msie", 1)  0 then
			browserIE = "true"
	elseif InStr(1, str, "firefox", 1)  0 then
			browserFirefox = "true"
	elseif InStr(1, str, "safari", 1)  0 then
			browserFirefox = "true"
	elseif InStr(1, str, "iphone", 1)  0 then
			browserIPhone = "true"
	end if


	if browserIPhone  "" then response.redirect ("index_iphone.asp")

%&#62;

pretty long winded but effective none the less, hope it helps!!

Kier

&lt;i&gt;&lt;b&gt;Greg's Note:&lt;/b&gt; This is a browser "sniffer" looking for "Msie", "Firefox", "Safari", or "iphone" in the user_agent string and then setting a string related to that browser as true.  You'll need to act upon whether &lt;code&gt;browserIE&lt;/code&gt;, &lt;code&gt;browserFirefox&lt;/code&gt; (which it sets to true for Firefox or Safari), or &lt;code&gt;browserIPhone&lt;/code&gt; is true, not on whether a mobile browser has been detected.  And if you base your action on just that, a lot of smaller browsers that are desktop-based, but don't use one of those 4 strings in their user_agent strings, will be treated as mobile browsers.

Also, unless you have a specific page for an IPhone at index_iphone.asp, you may want to take out the last line of code.&lt;/i&gt;</description>
		<content:encoded><![CDATA[<p>Larry,</p>
<p>detection for browsers in ASP(VBScript):</p>
<p>&lt;%<br />
str = Request.ServerVariables("http_user_agent")<br />
	if InStr(1, str, "msie", 1)  0 then<br />
			browserIE = "true"<br />
	elseif InStr(1, str, "firefox", 1)  0 then<br />
			browserFirefox = "true"<br />
	elseif InStr(1, str, "safari", 1)  0 then<br />
			browserFirefox = "true"<br />
	elseif InStr(1, str, "iphone", 1)  0 then<br />
			browserIPhone = "true"<br />
	end if</p>
<p>	if browserIPhone  "" then response.redirect ("index_iphone.asp")</p>
<p>%&gt;</p>
<p>pretty long winded but effective none the less, hope it helps!!</p>
<p>Kier</p>
<p><i><b>Greg's Note:</b> This is a browser "sniffer" looking for "Msie", "Firefox", "Safari", or "iphone" in the user_agent string and then setting a string related to that browser as true.  You'll need to act upon whether <code>browserIE</code>, <code>browserFirefox</code> (which it sets to true for Firefox or Safari), or <code>browserIPhone</code> is true, not on whether a mobile browser has been detected.  And if you base your action on just that, a lot of smaller browsers that are desktop-based, but don't use one of those 4 strings in their user_agent strings, will be treated as mobile browsers.</p>
<p>Also, unless you have a specific page for an IPhone at index_iphone.asp, you may want to take out the last line of code.</i></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Larry</title>
		<link>http://www.brainhandles.com/2007/10/15/detecting-mobile-browsers/#comment-5764</link>
		<dc:creator>Larry</dc:creator>
		<pubDate>Mon, 21 Jan 2008 17:53:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.brainhandles.com/2007/10/15/detecting-mobile-browsers/#comment-5764</guid>
		<description>Script looks great but I wish you had a ASP/vbscript version.....Like your site by the way....

Larry</description>
		<content:encoded><![CDATA[<p>Script looks great but I wish you had a ASP/vbscript version.....Like your site by the way....</p>
<p>Larry</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Greg Bulmash</title>
		<link>http://www.brainhandles.com/2007/10/15/detecting-mobile-browsers/#comment-5040</link>
		<dc:creator>Greg Bulmash</dc:creator>
		<pubDate>Mon, 14 Jan 2008 08:37:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.brainhandles.com/2007/10/15/detecting-mobile-browsers/#comment-5040</guid>
		<description>Jane,

This is actually complex enough an answer to deserve &lt;a href="http://www.brainhandles.com/2008/01/14/regular-expressions-a-bunch-of-little-ones-or-one-big-one/" rel="nofollow"&gt;its own post&lt;/a&gt;.

- Greg</description>
		<content:encoded><![CDATA[<p>Jane,</p>
<p>This is actually complex enough an answer to deserve <a href="http://www.brainhandles.com/2008/01/14/regular-expressions-a-bunch-of-little-ones-or-one-big-one/" rel="nofollow">its own post</a>.</p>
<p>- Greg</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jane</title>
		<link>http://www.brainhandles.com/2007/10/15/detecting-mobile-browsers/#comment-5027</link>
		<dc:creator>jane</dc:creator>
		<pubDate>Mon, 14 Jan 2008 06:53:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.brainhandles.com/2007/10/15/detecting-mobile-browsers/#comment-5027</guid>
		<description>Hi, 

I'm just learning PHP.

Can you explain to me why you do the foreach loop -- rather than just formatting $uamatches directly in regex syntax?

Is this more efficient processing, or more organized for you, or avoids some possible error getting thrown?

Thanks!</description>
		<content:encoded><![CDATA[<p>Hi, </p>
<p>I'm just learning PHP.</p>
<p>Can you explain to me why you do the foreach loop -- rather than just formatting $uamatches directly in regex syntax?</p>
<p>Is this more efficient processing, or more organized for you, or avoids some possible error getting thrown?</p>
<p>Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: whoever</title>
		<link>http://www.brainhandles.com/2007/10/15/detecting-mobile-browsers/#comment-4707</link>
		<dc:creator>whoever</dc:creator>
		<pubDate>Wed, 09 Jan 2008 13:06:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.brainhandles.com/2007/10/15/detecting-mobile-browsers/#comment-4707</guid>
		<description>If we're to believe http://www.mobileopera.com/reference/ua , Opera Mobile should be detected no problem, since it contains a platform and device strings at the very least in the UA string.

Anyway, thank you from me aswell for this code snippet. Works like a charm ;)

P.S.: it was interesting to find out that preg_match is actually faster than stripos. I always assumed it'd be the opposite :P</description>
		<content:encoded><![CDATA[<p>If we're to believe <a href="http://www.mobileopera.com/reference/ua" rel="nofollow">http://www.mobileopera.com/reference/ua</a> , Opera Mobile should be detected no problem, since it contains a platform and device strings at the very least in the UA string.</p>
<p>Anyway, thank you from me aswell for this code snippet. Works like a charm <img src='http://www.brainhandles.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>P.S.: it was interesting to find out that preg_match is actually faster than stripos. I always assumed it'd be the opposite <img src='http://www.brainhandles.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: john</title>
		<link>http://www.brainhandles.com/2007/10/15/detecting-mobile-browsers/#comment-4415</link>
		<dc:creator>john</dc:creator>
		<pubDate>Mon, 31 Dec 2007 07:42:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.brainhandles.com/2007/10/15/detecting-mobile-browsers/#comment-4415</guid>
		<description>Opera Mini and Opera Mobile are different...

http://www.opera.com/products/

&lt;i&gt;[Editor's Note: But in his follow-up, HeavyWave said he'd checked the script/demo with his phone, so it's a bit of a moot point.] &lt;/i&gt;</description>
		<content:encoded><![CDATA[<p>Opera Mini and Opera Mobile are different...</p>
<p><a href="http://www.opera.com/products/" rel="nofollow">http://www.opera.com/products/</a></p>
<p><i>[Editor's Note: But in his follow-up, HeavyWave said he'd checked the script/demo with his phone, so it's a bit of a moot point.] </i></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex Grim</title>
		<link>http://www.brainhandles.com/2007/10/15/detecting-mobile-browsers/#comment-4340</link>
		<dc:creator>Alex Grim</dc:creator>
		<pubDate>Sat, 29 Dec 2007 06:10:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.brainhandles.com/2007/10/15/detecting-mobile-browsers/#comment-4340</guid>
		<description>DIGG: This link does not appear to be a working link. Please check the URL and try again.

Sorry, i tried to digg ya. Great job man.</description>
		<content:encoded><![CDATA[<p>DIGG: This link does not appear to be a working link. Please check the URL and try again.</p>
<p>Sorry, i tried to digg ya. Great job man.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brain Handles &#187; Blog Archive &#187; Detecting Mobile Browsers Part 2</title>
		<link>http://www.brainhandles.com/2007/10/15/detecting-mobile-browsers/#comment-3297</link>
		<dc:creator>Brain Handles &#187; Blog Archive &#187; Detecting Mobile Browsers Part 2</dc:creator>
		<pubDate>Thu, 06 Dec 2007 04:01:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.brainhandles.com/2007/10/15/detecting-mobile-browsers/#comment-3297</guid>
		<description>[...] While a lot of people have written in with kudos on my PHP code for detecting mobile browsers, others have written in with questions on how to use it. [...]</description>
		<content:encoded><![CDATA[<p>[...] While a lot of people have written in with kudos on my PHP code for detecting mobile browsers, others have written in with questions on how to use it. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Feed UP !! &#187; .mobi domain extension &#8212; flop or must buy?</title>
		<link>http://www.brainhandles.com/2007/10/15/detecting-mobile-browsers/#comment-3154</link>
		<dc:creator>Feed UP !! &#187; .mobi domain extension &#8212; flop or must buy?</dc:creator>
		<pubDate>Sat, 01 Dec 2007 16:41:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.brainhandles.com/2007/10/15/detecting-mobile-browsers/#comment-3154</guid>
		<description>[...] #1 Web sites can automatically detect what platform a visitor is accessing the site through. Go to facebook.com on your phone, you end up at m.facebook.com. Its hassle-free to the end user. [...]</description>
		<content:encoded><![CDATA[<p>[...] #1 Web sites can automatically detect what platform a visitor is accessing the site through. Go to facebook.com on your phone, you end up at m.facebook.com. Its hassle-free to the end user. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: HeavyWave</title>
		<link>http://www.brainhandles.com/2007/10/15/detecting-mobile-browsers/#comment-1380</link>
		<dc:creator>HeavyWave</dc:creator>
		<pubDate>Mon, 15 Oct 2007 15:11:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.brainhandles.com/2007/10/15/detecting-mobile-browsers/#comment-1380</guid>
		<description>Didn't know there's a simulation. I just used my phone to check. :)

Nice script, thanks a lot.</description>
		<content:encoded><![CDATA[<p>Didn't know there's a simulation. I just used my phone to check. <img src='http://www.brainhandles.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Nice script, thanks a lot.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Greg Bulmash</title>
		<link>http://www.brainhandles.com/2007/10/15/detecting-mobile-browsers/#comment-1373</link>
		<dc:creator>Greg Bulmash</dc:creator>
		<pubDate>Mon, 15 Oct 2007 07:47:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.brainhandles.com/2007/10/15/detecting-mobile-browsers/#comment-1373</guid>
		<description>@HeavyWave,

Opera Mini (the java based version of Opera for mobile phones) is detected by the script.

You can test this by going to &lt;a href="http://www.operamini.com/demo/" rel="nofollow"&gt;the Opera Mini Simulator&lt;/a&gt; and then browsing to my test page at &lt;a href="http://www.brainhandles.com/testmobile.php" rel="nofollow"&gt;http://www.brainhandles.com/testmobile.php&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>@HeavyWave,</p>
<p>Opera Mini (the java based version of Opera for mobile phones) is detected by the script.</p>
<p>You can test this by going to <a href="http://www.operamini.com/demo/" rel="nofollow" onclick="javascript:pageTracker._trackPageview ('/outbound/www.operamini.com');">the Opera Mini Simulator</a> and then browsing to my test page at <a href="http://www.brainhandles.com/testmobile.php" rel="nofollow">http://www.brainhandles.com/testmobile.php</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: HeavyWave</title>
		<link>http://www.brainhandles.com/2007/10/15/detecting-mobile-browsers/#comment-1372</link>
		<dc:creator>HeavyWave</dc:creator>
		<pubDate>Mon, 15 Oct 2007 07:41:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.brainhandles.com/2007/10/15/detecting-mobile-browsers/#comment-1372</guid>
		<description>Will it detect Opera Mobile?</description>
		<content:encoded><![CDATA[<p>Will it detect Opera Mobile?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
