PHP
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Tutorialized ForumsWeb Design & DevelopmentPHP

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Tutorialized Forums Sponsor:
  #1  
Old August 30th, 2007, 09:00 AM
Admin Admin is offline
Developer Shed
Click here for more information.
 
Join Date: Jun 2007
Posts: 12,335 Admin User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 14
PHP Browser Redirect Tutorial

A situation may come up when you want to redirect a user depending on what browser they are using. Here is a simple PHP tutorial that will teach you how to redirect users depending upon what browser they are using.

Read the full article here: PHP Browser Redirect Tutorial

Reply With Quote
  #2  
Old August 30th, 2007, 09:27 AM
Chippo Chippo is offline
Contributing User
Tutorialized Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Location: Stockport, UK
Posts: 462 Chippo New User: is a brand new recruit and a unknown entity at this point. 
Time spent in forums: 23 h 28 m 4 sec
Reputation Power: 0
Send a message via MSN to Chippo
I'd like to note if you use this, and you echo something out before you try this you will get an error. in order to fix that use ob_start(); at the start of your code, and ob_end_flush(); at the end of your code.

PHP Code:
<?php
ob_start
();
echo 
"hello";
if (
$name strstr ($HTTP_USER_AGENT"MSIE")) { 
   
Header ("Location: http://www.msn.com/");
} else { 
   
Header ("Location: http://www.google.com/");

ob_end_flush();
?>

Reply With Quote
  #3  
Old August 30th, 2007, 09:54 AM
_Kenny_Programing_'s Avatar
_Kenny_Programing_ _Kenny_Programing_ is offline
Kpg Designs Inc.
Click here for more information
 
Join Date: Feb 2006
Location: Dayton, Ohio
Posts: 504 _Kenny_Programing_ New User: is a brand new recruit and a unknown entity at this point. 
Time spent in forums: 18 h 55 m 35 sec
Reputation Power: 0
Send a message via MSN to _Kenny_Programing_
lol go chippo woot
__________________
Need a website created?
Dont have much time to do it?
Tell us what you want and we will have it running within a week!
http://www.KpgDesigns.net

Reply With Quote
  #4  
Old August 30th, 2007, 10:38 AM
Chippo Chippo is offline
Contributing User
Tutorialized Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Location: Stockport, UK
Posts: 462 Chippo New User: is a brand new recruit and a unknown entity at this point. 
Time spent in forums: 23 h 28 m 4 sec
Reputation Power: 0
Send a message via MSN to Chippo
lol Id rather let them know then let them struggle for hours rackin there brain when I first tried to redirect after Id already echo'd summat out lol. Can be very confusing the first time to find out why it's not working lol

Reply With Quote
Reply

Viewing: Tutorialized ForumsWeb Design & DevelopmentPHP > PHP Browser Redirect Tutorial


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT