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:
    397
    Likes Received:
    114
    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 Jr. VIP Jr. VIP

    Joined:
    Sep 10, 2010
    Messages:
    3,764
    Likes Received:
    3,297
    Gender:
    Male
    Occupation:
    Dreaming
    Location:
    Pale Blue Dot
    Home Page:
    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:
    397
    Likes Received:
    114
    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:
    397
    Likes Received:
    114
    Does anyone know how I can do that?
     
  5. Gogol

    Gogol Jr. VIP Jr. VIP

    Joined:
    Sep 10, 2010
    Messages:
    3,764
    Likes Received:
    3,297
    Gender:
    Male
    Occupation:
    Dreaming
    Location:
    Pale Blue Dot
    Home Page:
    ^^ No spoonfeeding. Learn basic php, or outsource it :D
     
  6. umerjutt00

    umerjutt00 Jr. VIP Jr. VIP

    Joined:
    Oct 28, 2011
    Messages:
    3,966
    Likes Received:
    2,214
    Occupation:
    Ninja
    It can be done with php. There is a php code out there. I can't remember the site name so you gotta search for it on google.