PHP Code that Copies text
Moderator: General Moderators
PHP Code that Copies text
I have been looking/trying to create a PHP script that copies text upon entering it. like the way that Tinyurl copies the text onto the clipboard automatically when u create a new url.
So when a user clicks submit it will copy specific text onto the clipboard.
Thanks
So when a user clicks submit it will copy specific text onto the clipboard.
Thanks
Re: PHP Code that Copies text
Not entirely sure what you mean, but I'm guessing you want to transfer variable data from one page to the next. I suggesr either cookies (for VERY short term storage), seesions (ok, need to explain this more in-depth) to database entries (for long term to indefinite storage!), or you can use the $_POST/$_GET post data!
If you need more info on either of these I would be more than happy to explain, just PM me!
If you need more info on either of these I would be more than happy to explain, just PM me!
Re: PHP Code that Copies text
Basicly what is want is a script that automatically copies text onto the clipboard
Re: PHP Code that Copies text
I see, but I fail to see what possible implications that can have on a php script really, sounds more like a javascript function to me!
Re: PHP Code that Copies text
If you want a piece of text copied to the clipboard I suggest you use this piece of code,
and just replace the variable <?php echo $variable.'you wish to use'; ?> to what ever you want the variable to become and copy to the clipboard!
and just replace the variable <?php echo $variable.'you wish to use'; ?> to what ever you want the variable to become and copy to the clipboard!
Code: Select all
<SPAN ID="copytext" STYLE="height:whatever;width:whatever;background-color:grey">
<?php echo $variable.'you wish to use'; ?>
</SPAN>
<TEXTAREA ID="holdtext" STYLE="display:none;">
</TEXTAREA>
<BUTTON onClick="ClipBoard();">Copy to Clipboard</BUTTON>Re: PHP Code that Copies text
I think I found a solution but I dont know how to properly embed it. Any suggestions?8ennett wrote:I see, but I fail to see what possible implications that can have on a php script really, sounds more like a javascript function to me!
http://www.jeffothy.com/weblog/clipboard-copy/
Re: PHP Code that Copies text
Yes, my suggestion would be do NOT use the code you have recently discovered. If you do not understand my code (which does NOT even use javascript) then you should try to learn html before taking on the big boys, unless you know how to use the onclick function obviously?
If you haven't a clue what I'm sayin at all then go to google, look up 'PHP 101', and then learn something, next, go to a site that teaches you other languages besides PHP. If you know PHP/Javascript then you'll know what to do! If you know javascript then you don't need my help. If you don't know what either of these para's mean then learn how to program before learning a programming language!
If you haven't a clue what I'm sayin at all then go to google, look up 'PHP 101', and then learn something, next, go to a site that teaches you other languages besides PHP. If you know PHP/Javascript then you'll know what to do! If you know javascript then you don't need my help. If you don't know what either of these para's mean then learn how to program before learning a programming language!
Re: PHP Code that Copies text
Sorry, I missed your post. I used your code and it worked perfectly! Thank You!8ennett wrote:Yes, my suggestion would be do NOT use the code you have recently discovered. If you do not understand my code (which does NOT even use javascript) then you should try to learn html before taking on the big boys, unless you know how to use the onclick function obviously?
If you haven't a clue what I'm sayin at all then go to google, look up 'PHP 101', and then learn something, next, go to a site that teaches you other languages besides PHP. If you know PHP/Javascript then you'll know what to do! If you know javascript then you don't need my help. If you don't know what either of these para's mean then learn how to program before learning a programming language!
Re: PHP Code that Copies text
onclick is javascript.8ennett wrote:YIf you do not understand my code (which does NOT even use javascript)