Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3

Thread: Quick Copy

  1. #1
    New Coder
    Join Date
    Jul 2011
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Quick Copy

    Don't even know where to post this as I have never thought about it;

    I've just made my game have a image upload script in, and a album showing the users images. How could I make have a link saying "Copy Link" that if clicked will copy the picture url to clip board.

    I've seen places like w3schools use in but not as tuts though.

    Please this will really help, desplayin the link is ugly

    EDIT:

    I've found the following code but I don't understand how I turn it into a link or button.

    Code:
    <script> 
    window.clipboardData.setData('text','This has been copied to your clipboard.'); 
    </script>
    Last edited by hbro1095; 07-15-2011 at 03:33 AM.

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    This hasn't a thing to do with PHP. If you have a known url you are copying, the only way to do it is with a client technology.
    Moving from PHP to Javascript forum.

  • #3
    Senior Coder rnd me's Avatar
    Join Date
    Jun 2007
    Location
    Urbana
    Posts
    4,343
    Thanks
    11
    Thanked 589 Times in 570 Posts
    just present the image, all browsers have a save image functionality available in their right-click menu...

    or you can mess with 3-4 solutions to handle all the different browsers, and still only save the user a single click, all the while risking security popup warnings...
    my site (updated 13/9/26)
    BROWSER STATS [% share] (2014/5/28) IE7:0.1, IE8:5.3, IE11:8.4, IE9:3.2, IE10:3.2, FF:18.2, CH:46, SF:7.9, NON-MOUSE:32%


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •