Orionsbelter Posted June 3, 2008 Share Posted June 3, 2008 Hi i want to do something different for each brower, but don't no how to or if you can. here is what i want to do if($brower =="IE"){ echo"your using IE";} elseif($brower =="Firefox"){echo"your using firefox";} thanks to all those that look Link to comment https://forums.phpfreaks.com/topic/108526-browers-coding/ Share on other sites More sharing options...
samshel Posted June 3, 2008 Share Posted June 3, 2008 try using $_SERVER["HTTP_USER_AGENT"] Link to comment https://forums.phpfreaks.com/topic/108526-browers-coding/#findComment-556458 Share on other sites More sharing options...
Orionsbelter Posted June 3, 2008 Author Share Posted June 3, 2008 what to replace $brower and what would the browers be named IE or internet explore firefox or FF? Link to comment https://forums.phpfreaks.com/topic/108526-browers-coding/#findComment-556462 Share on other sites More sharing options...
samshel Posted June 3, 2008 Share Posted June 3, 2008 <?php $browser = $_SERVER['HTTP_USER_AGENT']; if(ereg("MSIE", $browser)) { echo "Internet Explorer"; } if(ereg("Firefox", $browser)) { echo "Firefox"; } ?> Link to comment https://forums.phpfreaks.com/topic/108526-browers-coding/#findComment-556465 Share on other sites More sharing options...
Rohan Shenoy Posted June 3, 2008 Share Posted June 3, 2008 Instead ereg functions use strpos() in this case. Link to comment https://forums.phpfreaks.com/topic/108526-browers-coding/#findComment-556492 Share on other sites More sharing options...
Orionsbelter Posted June 3, 2008 Author Share Posted June 3, 2008 how would the coding look for that? Link to comment https://forums.phpfreaks.com/topic/108526-browers-coding/#findComment-556626 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.