“Adsterra”/ “AdsKeeper”/
Welcome to Our Community
Wanting to join the rest of our members? Feel free to sign up today.

[I need help] Website Script for Visitors [Please Read]

Discussion in 'Programming and Scripts' started by IndeXer, Jan 18, 2016.

  1. IndeXer

    IndeXer Affiliate affiliate

    I have a brilliant idea, but for that idea to execute I need little help from you people. I am going to give an overview of it please let me know how can I compile those scripts.

    I am going to upload two tools in my website, one will be for Mac users and second will be for windows users, now I want something/script which can automatically detect Mac user and whenever mac user click on download it should download Mac version of my tool.

    Same thing should go with windows user, if a windows user click on download it should download windows version of my tool. Can somebody suggest anything how can I execute that and what type of script do I have to use.

    Any help will be highly appreciated.

    Note: English is not my first language.

  2. Voluum
  3. pablopicasso

    pablopicasso Affiliate affiliate

    Hi @indexer . I googled it now . I think u can use php for it which is
    Which is generated when page loads .Lets u know the OS being used

    Php Code :

    $user_agent = getenv("HTTP_USER_AGENT");

    if(strpos($user_agent,"Win")!== FALSE)
    $os ="Windows";
    elseif(strpos($user_agent,"Mac")!== FALSE)
    $os ="Mac";

    ANd u can use a php condition to run which tool to downlaod in what OS >

    if($os ==="Windows")

    elseif($os ==="Mac")


    I just tried it in mine Works ,:)
    IndeXer and K like this.
  4. plutarkosy

    plutarkosy Affiliate affiliate

    I think you can do this using javascript and don't require any server side code.

    You could use the navigator object and the appVersion property in particular, like so:

    if (navigator.appVersion.indexOf("Win")!=-1) --> Windows
    if (navigator.appVersion.indexOf("Mac")!=-1) --> Mac
  5. netabdo

    netabdo New Member affiliate

    Hi @IndeXer

    This response is late but I hope that will help others.

    You can use tokens from your traffic sources and with just tests like the response above you can filter the visitors and redirect them to any page you want.

    If you still need help in coding PM me here, I will be happy to help with that.

    Best Regards,
    IndeXer likes this.