<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Detecting Mobile Browsers Part 2</title>
	<atom:link href="http://www.brainhandles.com/techno-thoughts/detecting-mobile-browsers-part-2/feed" rel="self" type="application/rss+xml" />
	<link>http://www.brainhandles.com/techno-thoughts/detecting-mobile-browsers-part-2</link>
	<description>Whatever's tugging at my brain handles</description>
	<lastBuildDate>Wed, 17 Mar 2010 08:30:25 +0000</lastBuildDate>
	
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Paul</title>
		<link>http://www.brainhandles.com/techno-thoughts/detecting-mobile-browsers-part-2/comment-page-1#comment-9832</link>
		<dc:creator>Paul</dc:creator>
		<pubDate>Thu, 25 Feb 2010 00:51:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.brainhandles.com/2007/12/05/detecting-mobile-browsers-part-2/#comment-9832</guid>
		<description>Yeah, see regarding the index.php and index.html both existing situation, I&#039;ve tried to do that with an htaccess pointing to index.php as the primary listing and index.html as the first alternative; the goal being to have index.php contain the mobile redirect code, redirecting to a single static mobile page (index_m.html) or the standard website (index.html). Yeah, not W3 compliant by any stretch but I&#039;m very inexperienced, didn&#039;t have access to subdomains (groan) and to place the redirect code in the index page itself felt like I&#039;d be playing with fire. Plus, in the event of a serverside php problem, the site maintainer would only need to delete the php page and it&#039;d be up and running again.

Messy and it worked well for a while, but then funnily enough subsequently caused the server to later disable PHP entirely. Im guessing it was because of some hangup on an .php and .html clash but really have no clue there.

Either way, I&#039;m kinda afraid to touch the two indexes issue again.</description>
		<content:encoded><![CDATA[<p>Yeah, see regarding the index.php and index.html both existing situation, I've tried to do that with an htaccess pointing to index.php as the primary listing and index.html as the first alternative; the goal being to have index.php contain the mobile redirect code, redirecting to a single static mobile page (index_m.html) or the standard website (index.html). Yeah, not W3 compliant by any stretch but I'm very inexperienced, didn't have access to subdomains (groan) and to place the redirect code in the index page itself felt like I'd be playing with fire. Plus, in the event of a serverside php problem, the site maintainer would only need to delete the php page and it'd be up and running again.</p>
<p>Messy and it worked well for a while, but then funnily enough subsequently caused the server to later disable PHP entirely. Im guessing it was because of some hangup on an .php and .html clash but really have no clue there.</p>
<p>Either way, I'm kinda afraid to touch the two indexes issue again.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeremy</title>
		<link>http://www.brainhandles.com/techno-thoughts/detecting-mobile-browsers-part-2/comment-page-1#comment-7384</link>
		<dc:creator>Jeremy</dc:creator>
		<pubDate>Wed, 19 Nov 2008 09:20:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.brainhandles.com/2007/12/05/detecting-mobile-browsers-part-2/#comment-7384</guid>
		<description>Kenny, do you have an index.html file and an index.php file? That&#039;s the only reason I can think of that would cause your problem. If that is the case, the reason is that when you just type in www.mysite.com, your web server software (most likely apache) is picking the index.html file before it picks an index.php file. All you&#039;ll need to do is make your index.php file look like this:

&lt;?php
... [code from index.php]
?&gt;
[paste code from index.html]

Basically copy and paste the html code from index.html after the ?&gt; in the index.php file. Save it, then delete the index.html file. Now load up www.mysite.com and since there is no index.html file, it should automatically pick index.php and redirect correctly.</description>
		<content:encoded><![CDATA[<p>Kenny, do you have an index.html file and an index.php file? That's the only reason I can think of that would cause your problem. If that is the case, the reason is that when you just type in <a href="http://www.mysite.com" rel="nofollow">http://www.mysite.com</a>, your web server software (most likely apache) is picking the index.html file before it picks an index.php file. All you'll need to do is make your index.php file look like this:</p>
<p>&lt;?php<br />
... [code from index.php]<br />
?&gt;<br />
[paste code from index.html]</p>
<p>Basically copy and paste the html code from index.html after the ?&gt; in the index.php file. Save it, then delete the index.html file. Now load up <a href="http://www.mysite.com" rel="nofollow">http://www.mysite.com</a> and since there is no index.html file, it should automatically pick index.php and redirect correctly.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kenny</title>
		<link>http://www.brainhandles.com/techno-thoughts/detecting-mobile-browsers-part-2/comment-page-1#comment-7354</link>
		<dc:creator>Kenny</dc:creator>
		<pubDate>Tue, 04 Nov 2008 17:54:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.brainhandles.com/2007/12/05/detecting-mobile-browsers-part-2/#comment-7354</guid>
		<description>I have integrated and used the redirect code and it works flawlessly! :o)  but the code is inside index.php which is the home page of the main &quot;none mobile&quot; site. I want when someone is on a mobile to be able to type in http://www.mysite.com/ and it redirect. (only from a mobile, remember). Right now it only redirects if I type in my mobile the exact file directory http://www.mysite.com/index.php .....Any help would be greatly appreciated!</description>
		<content:encoded><![CDATA[<p>I have integrated and used the redirect code and it works flawlessly! <img src='http://www.brainhandles.com/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> )  but the code is inside index.php which is the home page of the main "none mobile" site. I want when someone is on a mobile to be able to type in <a href="http://www.mysite.com/" rel="nofollow">http://www.mysite.com/</a> and it redirect. (only from a mobile, remember). Right now it only redirects if I type in my mobile the exact file directory <a href="http://www.mysite.com/index.php" rel="nofollow">http://www.mysite.com/index.php</a> .....Any help would be greatly appreciated!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeremy</title>
		<link>http://www.brainhandles.com/techno-thoughts/detecting-mobile-browsers-part-2/comment-page-1#comment-7261</link>
		<dc:creator>Jeremy</dc:creator>
		<pubDate>Wed, 08 Oct 2008 22:14:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.brainhandles.com/2007/12/05/detecting-mobile-browsers-part-2/#comment-7261</guid>
		<description>I do apologize, it removed the code tags for my example. I&#039;ve uploaded a zip file with samples of a redirect and one with stylesheet switching to the following address:

&lt;a href=&quot;http://www.filesavr.com/checkmobileexample&quot; rel=&quot;nofollow&quot;&gt;http://www.filesavr.com/checkmobileexample&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>I do apologize, it removed the code tags for my example. I've uploaded a zip file with samples of a redirect and one with stylesheet switching to the following address:</p>
<p><a href="http://www.filesavr.com/checkmobileexample" rel="nofollow">http://www.filesavr.com/checkmobileexample</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeremy</title>
		<link>http://www.brainhandles.com/techno-thoughts/detecting-mobile-browsers-part-2/comment-page-1#comment-7260</link>
		<dc:creator>Jeremy</dc:creator>
		<pubDate>Wed, 08 Oct 2008 21:58:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.brainhandles.com/2007/12/05/detecting-mobile-browsers-part-2/#comment-7260</guid>
		<description>Nick and Marise, I think this is what you mean. Create a file called checkmobile.php in notepad and paste in the following modified checkmobile function:

&lt;code&gt;

&lt;/code&gt;

Now in your xHTML/PHP (index.php, for example), you start the file with the following:

&lt;code&gt;

&lt;/code&gt;

Then begin your markup (HTML/xHTML) after that. If you are just switching stylesheets and not redirecting, move the code to where you want to declare your stylesheets and simply replace the header and exit lines with something like the following:

&lt;code&gt;
  case &quot;iphone&quot;:
    echo &quot;&quot;;
  break;
&lt;/code&gt;

Hope that helps. You may have solved the problem already but others may be searching.</description>
		<content:encoded><![CDATA[<p>Nick and Marise, I think this is what you mean. Create a file called checkmobile.php in notepad and paste in the following modified checkmobile function:</p>
<p><code></p>
<p></code></p>
<p>Now in your xHTML/PHP (index.php, for example), you start the file with the following:</p>
<p><code></p>
<p></code></p>
<p>Then begin your markup (HTML/xHTML) after that. If you are just switching stylesheets and not redirecting, move the code to where you want to declare your stylesheets and simply replace the header and exit lines with something like the following:</p>
<p><code><br />
  case "iphone":<br />
    echo "";<br />
  break;<br />
</code></p>
<p>Hope that helps. You may have solved the problem already but others may be searching.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gordon</title>
		<link>http://www.brainhandles.com/techno-thoughts/detecting-mobile-browsers-part-2/comment-page-1#comment-6978</link>
		<dc:creator>Gordon</dc:creator>
		<pubDate>Mon, 04 Aug 2008 10:54:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.brainhandles.com/2007/12/05/detecting-mobile-browsers-part-2/#comment-6978</guid>
		<description>I gues it would look like this...

if(checkmobile() == &quot;iphone&quot;)
{
      header(&quot;Location:http://www.whatever-url-you-want.com&quot;);
}
else if(checkmobile() == &quot;mobile&quot;)
{
      header(&quot;Location:http://www.mobilesite.com&quot;);
}
else
{
      //normal browser, do nothing
}</description>
		<content:encoded><![CDATA[<p>I gues it would look like this...</p>
<p>if(checkmobile() == "iphone")<br />
{<br />
      header("Location:http://www.whatever-url-you-want.com");<br />
}<br />
else if(checkmobile() == "mobile")<br />
{<br />
      header("Location:http://www.mobilesite.com");<br />
}<br />
else<br />
{<br />
      //normal browser, do nothing<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: marise</title>
		<link>http://www.brainhandles.com/techno-thoughts/detecting-mobile-browsers-part-2/comment-page-1#comment-6911</link>
		<dc:creator>marise</dc:creator>
		<pubDate>Mon, 14 Jul 2008 02:30:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.brainhandles.com/2007/12/05/detecting-mobile-browsers-part-2/#comment-6911</guid>
		<description>Hi,
I have the same question as Nick Fox. What&#039;s the entire PHP code that I&#039;d need to add to add to allow desktop browsers through, but to redirect iPhone users to one page, and mobile users to another?  Any help would be really appreciated.
Thanks!</description>
		<content:encoded><![CDATA[<p>Hi,<br />
I have the same question as Nick Fox. What's the entire PHP code that I'd need to add to add to allow desktop browsers through, but to redirect iPhone users to one page, and mobile users to another?  Any help would be really appreciated.<br />
Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Greg Bulmash</title>
		<link>http://www.brainhandles.com/techno-thoughts/detecting-mobile-browsers-part-2/comment-page-1#comment-6894</link>
		<dc:creator>Greg Bulmash</dc:creator>
		<pubDate>Mon, 07 Jul 2008 23:09:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.brainhandles.com/2007/12/05/detecting-mobile-browsers-part-2/#comment-6894</guid>
		<description>Right now the checkmobile() function returns &quot;true&quot; or &quot;false&quot;.  It would have to be rejiggered to return an A/B/C option (mobile, non-mobile, iphone).  Then instead of if(checkmobile()), you&#039;d have if (checkmobile()==&quot;iphone&quot;) or something to that extent so that you could execute different code.</description>
		<content:encoded><![CDATA[<p>Right now the checkmobile() function returns "true" or "false".  It would have to be rejiggered to return an A/B/C option (mobile, non-mobile, iphone).  Then instead of if(checkmobile()), you'd have if (checkmobile()=="iphone") or something to that extent so that you could execute different code.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: NickFox</title>
		<link>http://www.brainhandles.com/techno-thoughts/detecting-mobile-browsers-part-2/comment-page-1#comment-6891</link>
		<dc:creator>NickFox</dc:creator>
		<pubDate>Mon, 07 Jul 2008 10:45:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.brainhandles.com/2007/12/05/detecting-mobile-browsers-part-2/#comment-6891</guid>
		<description>This is a great script, but what if I STILL want to direct iPhone users to another site (and not the mobile site), say iphone.mysite.com where all other mobiles are directed to mobile.mysite.com. (and desktop browsers still bypass and go to www.mysite.com)
Thx
Nick</description>
		<content:encoded><![CDATA[<p>This is a great script, but what if I STILL want to direct iPhone users to another site (and not the mobile site), say iphone.mysite.com where all other mobiles are directed to mobile.mysite.com. (and desktop browsers still bypass and go to <a href="http://www.mysite.com" rel="nofollow">http://www.mysite.com</a>)<br />
Thx<br />
Nick</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kevin Sangeelee</title>
		<link>http://www.brainhandles.com/techno-thoughts/detecting-mobile-browsers-part-2/comment-page-1#comment-6822</link>
		<dc:creator>Kevin Sangeelee</dc:creator>
		<pubDate>Sat, 17 May 2008 18:07:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.brainhandles.com/2007/12/05/detecting-mobile-browsers-part-2/#comment-6822</guid>
		<description>Regarding the exit() suggestion, w3c recommendations are that you include a little markup that provides a &#039;Click here&#039; link in case the redirect fails to work, so perhaps a conditional bit of XHTML would be a better option.</description>
		<content:encoded><![CDATA[<p>Regarding the exit() suggestion, w3c recommendations are that you include a little markup that provides a 'Click here' link in case the redirect fails to work, so perhaps a conditional bit of XHTML would be a better option.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Spoom</title>
		<link>http://www.brainhandles.com/techno-thoughts/detecting-mobile-browsers-part-2/comment-page-1#comment-6805</link>
		<dc:creator>Spoom</dc:creator>
		<pubDate>Wed, 07 May 2008 15:43:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.brainhandles.com/2007/12/05/detecting-mobile-browsers-part-2/#comment-6805</guid>
		<description>You might want to put an exit(); after the header(...); line, so that the page stops sending needlessly after the redirect is sent.  Like so:

if(checkmobile())
{
  header(&quot;Location:http://www.whatever-url-you-want.com&quot;);
  exit();
}
// etc.</description>
		<content:encoded><![CDATA[<p>You might want to put an exit(); after the header(...); line, so that the page stops sending needlessly after the redirect is sent.  Like so:</p>
<p>if(checkmobile())<br />
{<br />
  header("Location:http://www.whatever-url-you-want.com");<br />
  exit();<br />
}<br />
// etc.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brain Handles &#187; Blog Archive &#187; Detecting Mobile Browsers</title>
		<link>http://www.brainhandles.com/techno-thoughts/detecting-mobile-browsers-part-2/comment-page-1#comment-3299</link>
		<dc:creator>Brain Handles &#187; Blog Archive &#187; Detecting Mobile Browsers</dc:creator>
		<pubDate>Thu, 06 Dec 2007 04:07:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.brainhandles.com/2007/12/05/detecting-mobile-browsers-part-2/#comment-3299</guid>
		<description>[...] UPDATE #2: Need help using the code in this article? I&#039;ve written a second article with code to help you handle your mobile users when this piece of code detects them. [...]</description>
		<content:encoded><![CDATA[<p>[...] UPDATE #2: Need help using the code in this article? I've written a second article with code to help you handle your mobile users when this piece of code detects them. [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
