tronicsmasta Posted May 19, 2008 Share Posted May 19, 2008 Hey guys, I need to insert a break if they use IE and not if they use firefox thanks, quinton Link to comment https://forums.phpfreaks.com/topic/106247-solved-browser-compatibility/ Share on other sites More sharing options...
DarkWater Posted May 19, 2008 Share Posted May 19, 2008 A break...? O_O Link to comment https://forums.phpfreaks.com/topic/106247-solved-browser-compatibility/#findComment-544552 Share on other sites More sharing options...
tronicsmasta Posted May 19, 2008 Author Share Posted May 19, 2008 eg: if (browser = IE) { echo "<br>"; } if (browser = Mozilla) { echo "whatever i need here"; } echo "$_SERVER['HTTP_USER_AGENT']"; // Outputs for Mozilla -- Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14 // or IE -- Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; .NET CLR 1.1.4322; .NET CLR 2.0.50727) Link to comment https://forums.phpfreaks.com/topic/106247-solved-browser-compatibility/#findComment-544559 Share on other sites More sharing options...
DarkWater Posted May 19, 2008 Share Posted May 19, 2008 $browser = $_SERVER['HTTP_USER_AGENT']; if (strpos($browser, "MSIE")) { echo "<br />"; } elseif (strpos($browser, "Mozilla")) { //echo stuff } else { } //You can exclude this if you want, but w/e. Link to comment https://forums.phpfreaks.com/topic/106247-solved-browser-compatibility/#findComment-544562 Share on other sites More sharing options...
tronicsmasta Posted May 19, 2008 Author Share Posted May 19, 2008 Great Thanks! Link to comment https://forums.phpfreaks.com/topic/106247-solved-browser-compatibility/#findComment-544604 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.