I am looking for alittle help with this. I am not very familar with PHP. Actually I take that back. I have taken a crash course to make some cosmetic changes. Other than that I don't know crap. I have the javascript to cause an action to be created to clipboard (see below). The problem that I am having is that I want the item that is copied to the clip board be based on the new shortened url that is created. What goes in the copy('')? Should this be placed in the php brackets or not?This is the same javascript that TinyURL uses. Thanks for all your help. <script type="text/javascript" language="javascript"><!-- function copy(text2copy) { if (window.clipboardData) { window.clipboardData.setData("Text",text2copy); } else { var flashcopier = 'flashcopier'; if(!document.getElementById(flashcopier)) { var divholder = document.createElement('div'); divholder.id = flashcopier; document.body.appendChild(divholder); } document.getElementById(flashcopier).innerHTML = ''; var divinfo = '<embed src="_clipboard.swf" FlashVars="clipboard='+escape(text2copy)+'" width="0" height="0" type="application/x-shockwave-flash"></embed>'; document.getElementById(flashcopier).innerHTML = divinfo; } } copy('WHAT GOES HERE???'); document.getElementById('copyinfo').innerHTML = "To paste it in a document, press and hold down the ctrl key while pressing the V key, or choose the "paste" option from the edit menu.<br />"; //--> </script> Code (markup):
Lol, well what they do is in their 'create.php' script they do something like: // Create and store the 'tiny url' // Echo javascript function "copy" // $theTinyLink = generated link, like http://tinyurl.com/8kp echo "copy('" . $theTinyLink . ");"; PHP: Then it just echo's the link that is generated, when the page loads the javascript is executed and the link is copied over. So yes, technically it has to be in <? ?> but basically your just echoing the javascript function and link.
Hey man thank you so much for you help. You really know your PHP. If I know anyone that needs a programmer I will send them your way!