IE oder netscape?

Einklappen
Dieses Thema ist geschlossen.
X
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

  • IE oder netscape?

    hat jemand von euch ein PHP-Script mit dem man heraus findet welcher browser verwendet wird?
    Danke
    IPAS

    php-Entwicklung | ebiz-consult.de
    PHP-Webhosting für PHP Entwickler | ebiz-webhosting.de
    die PHP Marktplatz-Software | ebiz-trader.de

  • #2
    have fun

    <?
    /////////////////////////////////////////////////////////////////////
    //
    // Browser Detection
    // by Sascha Blansjaar
    //
    // Feel free to modify this script in any way you want.
    //
    // No link back is required but much appreciated.
    // Link back to http://phtml.com/
    //
    /////////////////////////////////////////////////////////////////////

    echo "Your browser is: $HTTP_USER_AGENT<br><br>\n";

    // browser detection
    // MSIE 4 or 5?
    if(eregi("msie.[4|5]",$HTTP_USER_AGENT))
    $browser = "msie";
    // Netscape Navigator?
    else if(eregi("nav",$HTTP_USER_AGENT))
    $browser = "nav";
    else
    $browser = "other";

    // select which stylesheet to use
    if($browser == "msie")
    // is it almost christmas?
    if(date("z") > 350)
    {
    echo "It is almost Christmas<br><br>\n";
    echo "phtml.com uses /css/msiexmas.css for your browser<br><br>\n";
    }
    else
    {
    echo "phtml.com uses /css/msie.css for your browser<br><br>\n";
    }
    else
    {
    // is it almost christmas?
    if(date("z") > 350)
    {
    echo "It is almost Christmas<br><br>\n";
    echo "phtml.com uses /css/otherxmas.css for your browser<br><br>\n";
    }
    else
    {
    echo "phtml.com uses /css/other.css for your browser<br><br>\n";
    }
    }

    // select which bookmark code to display
    echo "and uses this bookmark code:<br>\n";
    if($browser == "msie")
    {
    echo "<span style='color:blue;cursor:hand;'
    onclick='window.external.AddFavorite(\"http://phtml.com/\", \"phtml.com - Free PHP Scripts\");'>Click here to bookmark phtml.com</span>";
    }
    elseif($browser == "nav")
    echo "Bookmark phtml.com (Press CTRL+D)";
    else
    echo "Don't forget to bookmark phtml.com";

    ?><?
    /////////////////////////////////////////////////////////////////////
    //
    // Browser Detection
    // by Sascha Blansjaar
    //
    // Feel free to modify this script in any way you want.
    //
    // No link back is required but much appreciated.
    // Link back to http://phtml.com/
    //
    /////////////////////////////////////////////////////////////////////

    echo "Your browser is: $HTTP_USER_AGENT<br><br>\n";

    // browser detection
    // MSIE 4 or 5?
    if(eregi("msie.[4|5]",$HTTP_USER_AGENT))
    $browser = "msie";
    // Netscape Navigator?
    else if(eregi("nav",$HTTP_USER_AGENT))
    $browser = "nav";
    else
    $browser = "other";

    // select which stylesheet to use
    if($browser == "msie")
    // is it almost christmas?
    if(date("z") > 350)
    {
    echo "It is almost Christmas<br><br>\n";
    echo "phtml.com uses /css/msiexmas.css for your browser<br><br>\n";
    }
    else
    {
    echo "phtml.com uses /css/msie.css for your browser<br><br>\n";
    }
    else
    {
    // is it almost christmas?
    if(date("z") > 350)
    {
    echo "It is almost Christmas<br><br>\n";
    echo "phtml.com uses /css/otherxmas.css for your browser<br><br>\n";
    }
    else
    {
    echo "phtml.com uses /css/other.css for your browser<br><br>\n";
    }
    }

    // select which bookmark code to display
    echo "and uses this bookmark code:<br>\n";
    if($browser == "msie")
    {
    echo "<span style='color:blue;cursor:hand;'
    onclick='window.external.AddFavorite(\"http://phtml.com/\", \"phtml.com - Free PHP Scripts\");'>Click here to bookmark phtml.com</span>";
    }
    elseif($browser == "nav")
    echo "Bookmark phtml.com (Press CTRL+D)";
    else
    echo "Don't forget to bookmark phtml.com";

    ?>

    php-Entwicklung | ebiz-consult.de
    PHP-Webhosting für PHP Entwickler | ebiz-webhosting.de
    die PHP Marktplatz-Software | ebiz-trader.de

    Kommentar

    Lädt...
    X