1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Needed - Redirector Script based on OS Bit Version 32 v 64

Discussion in 'Cloaking and Content Generators' started by eestisiin, Apr 27, 2013.

  1. eestisiin

    eestisiin Regular Member

    Joined:
    Oct 8, 2007
    Messages:
    329
    Likes Received:
    156
    Title pretty much says it all, since I have two kind of users - one 32 bit and other with 64 bit and two download buttons is not an option, then I would need some redirector script, I have seen ones which redirect windows and mac differently, but how to do that?

    With greetings,
    eestisiin
     
  2. fatboy

    fatboy Elite Member

    Joined:
    Aug 13, 2008
    Messages:
    1,618
    Likes Received:
    3,227
    Occupation:
    Retired
    Location:
    Old Peoples Home
    At a guess you would probably be limited to try to guess the 32/64 windows/mac thing from the useragent presented to your site. Downside is they are easily changed client side so not 100% dependable but at least you have a starting point :)

    EDIT: Saying that it may only be IE that gives those details (WOW64/WIN64 etc)
     
    Last edited: Apr 27, 2013
  3. eestisiin

    eestisiin Regular Member

    Joined:
    Oct 8, 2007
    Messages:
    329
    Likes Received:
    156
    Hmm, that is actually a good idea, but does one have a somewhat ready made script or smth? think the browser info is good enough and should be as accurate I need.. :)
     
  4. FireSoftLimited

    FireSoftLimited Junior Member

    Joined:
    Apr 27, 2013
    Messages:
    119
    Likes Received:
    25
    Location:
    Google UK


    Other browsers also passing that information.

    User agent is easiest way to get it. If you have MS server then I can send you info about very simple script which can give you information if this is 32 or 64bit system...
     
  5. fatboy

    fatboy Elite Member

    Joined:
    Aug 13, 2008
    Messages:
    1,618
    Likes Received:
    3,227
    Occupation:
    Retired
    Location:
    Old Peoples Home
    Try something like this, change for your needs:

    Code:
    <?php
    
            $ua = $_SERVER['HTTP_USER_AGENT'];
            if(strpos($ua,'64'))
            {
                    echo "Possibly 64bit";
            }
            else
            {
                    echo "Possibly 32bit";
            }
    ?>
    
     
  6. Grizzy

    Grizzy Senior Member

    Joined:
    Nov 11, 2008
    Messages:
    919
    Likes Received:
    999
    Only semi-reliable on Windows, but here's some javascript.

    Code:
    (function(win){
    
      var loc = win.location, nav = win.navigator; 
    
      if(/Win32|Win64|Win16/.test(nav.platform)){ // is Windows UA
    
        if(/x86_64|x86-64|Win64|x64;|amd64|AMD64|WOW64|x64_64/.test(nav.userAgent)){  // detected 64 bit in Windows UA
    
          loc.href = 'http://google.com/';
       
        }
        else { // didn't detect 64 bit in Windows UA 
      
          loc.href = 'http://facebook.com/';
    
        }
        
      }
      else { // not a Windows UA..
    
        loc.href = 'http://yahoo.com/';
    
      }	
    })(window);
    However you decide sniff and search the user agent, don't just rely on the presence of "64" alone. That will lead to false positives.