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

Download button redirect based upon device

Discussion in 'HTML & JavaScript' started by fheaky, May 18, 2014.

  1. fheaky

    fheaky Regular Member

    Joined:
    May 3, 2010
    Messages:
    349
    Likes Received:
    109
    Hey guys,

    I was wondering whether it was possible to add a code to a download button so that it redirects users upon them clicking the download button to a certain link based upon their device.

    I want people with all devices that do not run windows to go to link A
    And people who do run windows to go to link B

    Would it be possible to do this?
     
  2. Gogol

    Gogol Elite Member

    Joined:
    Sep 10, 2010
    Messages:
    3,063
    Likes Received:
    2,872
    Gender:
    Male
    yupp that's definitely doable. If you are using php, this would solve your problem:
    Code:
    http://stackoverflow.com/a/18070424/1437261
     
  3. fheaky

    fheaky Regular Member

    Joined:
    May 3, 2010
    Messages:
    349
    Likes Received:
    109
    Thank you. But I don't really understand coding, it's never really been my thing. All I understand from that is that they explain how the operating system in retrieved from the browser, but I really can't figure out how to implement it into a download button to make windows go to link A and all others to link B.
     
  4. fheaky

    fheaky Regular Member

    Joined:
    May 3, 2010
    Messages:
    349
    Likes Received:
    109
    Does anyone know how I can do that?
     
  5. Gogol

    Gogol Elite Member

    Joined:
    Sep 10, 2010
    Messages:
    3,063
    Likes Received:
    2,872
    Gender:
    Male
    ^^ No spoonfeeding. Learn basic php, or outsource it :D
     
  6. umerjutt00

    umerjutt00 Jr. VIP Jr. VIP Premium Member

    Joined:
    Oct 28, 2011
    Messages:
    3,644
    Likes Received:
    1,904
    Occupation:
    Ninja