“mobile”/ Voluum
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

    711
    385
    63
    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.

    Regards
    IndeXer
     
  2. CPA Evolution
  3. pablopicasso

    pablopicasso Affiliate affiliate

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

    Php Code :

    <?php
    $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 >

    <?php
    if($os ==="Windows")
    {

    }
    elseif($os ==="Mac")
    {

    }
    ?>

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

    plutarkosy Affiliate affiliate

    60
    13
    3
    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

    27
    6
    3
    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,
    Netabdo
     
    IndeXer likes this.
banners