Page 2 of 2 FirstFirst 12
Results 11 to 12 of 12

Thread: Need Script

  1. #11
    Join Date
    Jan 2007
    Location
    Canada eh?
    Posts
    766
    Tokens
    75

    Default

    For your original request, the IE thing the code is below, it's in javascript:

    Code:
    <script>
    version=parseInt(navigator.appVersion);
    if (navigator.appVersion.indexOf('5.')>-1){version=5};
    if (navigator.appVersion.indexOf('6.')>-1){version=6}; 
    if (navigator.appName=='Microsoft Internet Explorer'){browser='MSIE'+version;} 
    if (navigator.appVersion.indexOf('MSIE 3')>0) {browser='MSIE3';} 
    if (browser=='MSIE3') {docment.write(Site Best Viewed In FF)}
    if (browser=='MSIE4') {document.write(Site Best Viewed In FF)}
    if (browser=='MSIE5') {document.write(Site Best Viewed In FF)}
    if (browser=='MSIE6') {document.write(Site Best Viewed In FF)}
    if (browser=='MSIE7') {document.write(Site Best Viewed In FF)}
    <script>
    Pretty straight forward.... if their browser is any version of MSIE then it will display "Site Best Viewed In FF" - hope this helps!

    EDIT: Invent must have posted while I was writing... sorry?
    Last edited by QuickScriptz; 17-03-2007 at 04:35 PM.

  2. #12
    Join Date
    Nov 2005
    Location
    Australia
    Posts
    1,086
    Tokens
    111

    Latest Awards:

    Default

    Quote Originally Posted by Invent View Post
    Did this in 10 secs in PHP.

    Not done very well, but does the job.

    Code:
    <?php
     
    $browser = $_SERVER['HTTP_USER_AGENT'];
     
    if(preg_match("/MSIE/i", $browser)) {
    echo("<script language=\"Javascript\">
     
    alert (\"Sorry, our site is not compatible with Microsoft Internet Explorer!\")
     
    </script>");
    }
     
    ?>
    Thanks this is sorta what I need, but I was more wanting it to be in a footer so it stays there until they switch to firefox.


Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •