Apache2Triad Help, Support and Development Forum Index Apache2Triad Help, Support and Development
The apache2triad help , support and development forums
 

Browser Check
Click here to go to the original topic

 
       Apache2Triad Help, Support and Development Forum Index -> Programming
View previous topic :: View next topic  
Author Message
QWERTYtech



Joined: 03 May 2006
Posts: 47

Posted: Wed Jul 05, 2006 7:55 pm    Post subject: Browser Check  

I was wondering if anyone has a JavasScript or PHP function that checks all the known browser types. I am currently havin problems viewing pictures in a pop-up window. I am using Mozilla and I don't have pop-up blocker turned on. I can view the pics just fine through IE. Can anyone help me with this please?

site http://redbeardcustoms.no-ip.info/WebSite/garage.html

Thanks,
QWERTYtech
Back to top  
dale



Joined: 11 Jun 2006
Posts: 51
Location: las vegas, nv

Posted: Sat Jul 15, 2006 3:38 am    Post subject:  

This might help you. It's an outside link.

http://www.webmasterworld.com/forum26/119.htm
Back to top  
Joshua Meadows (DemoRic)



Joined: 29 Dec 2004
Posts: 785
Location: S.E. Kansas

Posted: Sun Jul 16, 2006 12:50 am    Post subject:  

I search the http_user_agent for certain strings to determine browsers.

Example PHP Code:
Code: $browser = $_SERVER['HTTP_USER_AGENT'];
/** General Notes:
*  $browser will contain one of the following values:
*      'iewin' : IE 4+ for Windows
*      'iemac' : IE 4 for Macintosh
*     'ie5mac' : IE 5 Macintosh
*      'nswin' : Netscape 4.x Windows
*     'nsunix' : Netscape 4.x Unix
*      'nsmac' : Netscape 4.x Mac
*        'ns6' : Netscape 6 / Mozilla
*/

if(preg_match("/firefox/i", $browser)) {
   //Do Nothing
} else {
   $CleanE107SitebaseAndPluginbase = SITEURLBASE.e_PLUGIN_ABS;
   $head = "Get Firefox";   
   if(preg_match("/iewin/i", $browser)||preg_match("/iemac/i", $browser)||preg_match("/ie 6/i", $browser)||preg_match("/ie 7/i", $browser) ) {
      $text = " <center><a href='http://www.mozilla.com/firefox/' target='_blank'>
      <img src= '$CleanE107SitebaseAndPluginbase/firefox_discoverer/images/clippy.gif' /></a></center> ";
      $text .="<b>Client Info:</b> ".$browser;         
   } else {
      $text = " <center><a href='http://www.mozilla.com/firefox/' target='_blank'>
      <img src= '$CleanE107SitebaseAndPluginbase/firefox_discoverer/images/nofirefox.gif' /></a></center> ";
      $text .="<b>Client Info:</b> ".$browser;
   } 
   $ns -> tablerender($head,$text);
}
Back to top  
 
       Apache2Triad Help, Support and Development Forum Index -> Programming
Page 1 of 1


Powered by phpBB Search Engine Indexer
Powered by phpBB 2.0.13 © 2001, 2002 phpBB Group