1 Hyperlink to 2 URL Code

Discussion in 'Programming' started by point2, Aug 2, 2014.

  1. #1
    I know how to hyperlink but I am interested to create a link that links to 1 URL/Site and a download URL (doesn't have to open). I have been searching around and I still have not found any code.

    Anyone can help me?
     
    point2, Aug 2, 2014 IP
  2. vivdub

    vivdub Member

    Messages:
    15
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    31
    #2
    http://stackoverflow.com/questions/7263923/how-to-force-file-download-with-php
     
    vivdub, Aug 2, 2014 IP
  3. webshore88

    webshore88 Well-Known Member

    Messages:
    131
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    123
    #3
    Use this

    <a href="second_page.php" onclick="return download_me()">Click Me</a>
    
    <script>
    function download_me(){
        window.top.location.href = 'download_me_please.php';
        return false;
    }
    </script>
    HTML:
     
    webshore88, Aug 3, 2014 IP
  4. point2

    point2 Active Member

    Messages:
    698
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    75
    #4
    download_me_please.php - This is the URL for download correct? sorry my knowledge is only basic.
     
    point2, Aug 3, 2014 IP
  5. webshore88

    webshore88 Well-Known Member

    Messages:
    131
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    123
    #5
    Ya download_me_please.php for download and second_page.php is the second link.
     
    webshore88, Aug 3, 2014 IP
  6. point2

    point2 Active Member

    Messages:
    698
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    75
    #6
    ok thanks..
     
    point2, Aug 4, 2014 IP