redirect user accourding to their browser type

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Winter
Forum Newbie
Posts: 15
Joined: Fri Feb 07, 2003 12:29 pm
Location: Texas
Contact:

redirect user accourding to their browser type

Post by Winter »

Hi, everyone:

Would you please tell me how do I redirect user to pages according to their browser type? for example: redirect the users who use IE to 111.htm, and redirect the users who use Netscape to 222.htm.

Thank you so much

Winter :oops:
User avatar
daven
Forum Contributor
Posts: 332
Joined: Tue Dec 17, 2002 1:29 pm
Location: Gaithersburg, MD
Contact:

Post by daven »

use get_browser()/$_SERVER['HTTP_USER_AGENT'] in combination with header().
bionicdonkey
Forum Contributor
Posts: 132
Joined: Fri Jan 31, 2003 2:28 am
Location: Sydney, Australia
Contact:

Post by bionicdonkey »

this is what i use for stylesheets:

Code: Select all

<?php
if (eregi("msie", $_SERVER['HTTP_USER_AGENT'])) {
	echo "<link href="css/iestyle.css" rel="stylesheet" type="text/css">";
} else {
	echo "<link href="css/nsstyle.css" rel="stylesheet" type="text/css">";
}
?>
Winter
Forum Newbie
Posts: 15
Joined: Fri Feb 07, 2003 12:29 pm
Location: Texas
Contact:

Post by Winter »

Thank you so much..
I solve the problem.. :D
Post Reply