<?xml version="1.0" encoding="utf-8"?>
<tutorial>

<description>Learn how to do a Browser Redirect using the power of PHP.</description>
<keywords>tutorial, PHP, tutorials, browser, redirect, browser redirection</keywords>
<title>Browser Redirect</title>

<slug>
Learn how to do a Browser Redirect using the power of PHP.
</slug>

<text>
Alright, this is a simple little script which will take you to one page if you're using Internet Explorer, and another page if you're using some other browser. Lets decide what this is going to do in English:
<ol>
	<li>If the browser is MicroSoft Internet Explorer (MSIE), then go to spoono.com</li>
	<li>If the browser isn't MSIE, then redirect to yahoo.com.</li>
</ol>
<b>The most essential part of this is that this code has to be sent out before any output to the HTML page.</b> Make sure it is the first line of code on your PHP page. With that said, here is the PHP:
<![CDATA[
<pre>
&lt;?
//if its MSIE then
if ($name = strstr ($HTTP_USER_AGENT, "MSIE")) 
{ 
   //go to Spoono
   Header ("Location: http://www.spoono.com/");
} 
else 
{ 
   //else go to Yahoo
   Header ("Location: http://www.yahoo.com/");
} 
?&gt; 
</pre>
]]>
Its not as hard as it looks in the beginning, is it? Simple and easy to do.
</text>

</tutorial>

