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. If the browser is Microsoft Internet
Explorer, then go to spoono.com. Anything else, go to yahoo.com.
Browser Redirect
Learn how to do a Browser Redirect using the power of PHP.
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:
- If the browser is MicroSoft Internet Explorer (MSIE), then go to spoono.com
- If the browser isn't MSIE, then redirect to yahoo.com.
The most essential part of this is that this code has to be sent out before any output to the HTML page. Make sure it is the first line of code on your PHP page. With that said, here is the PHP:
//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/");
}
?>
|