Copy Link Variable into my clipboard using php javascript

I have a problem ive been working on when i have linkings coming from database and would like to get these links displays so when i click on 1 link for say id it give mes the url eg mydomain,com/index.php?id=1 into my clipboard

here is mhy codeindent preformatted text by 4 spaces

[CODE]?>


<? include("dbconnect.php"); ?>






<?
$uQuery=“SELECT * FROM Leads”;
$result=mysqli_query($con,$uQuery);
if(!$result)
{
echo “Error:”.mysqli_error($con);
}
else
{
$count=$result->num_rows;
if($count>0)
{

			while($data=mysqli_fetch_array($result))
			{
				$addy = 'http://www.'.$_SERVER['SERVER_NAME'].'/index.php?id='.$data['LID'].'';
				echo '<tr>
        	<th colspan="2">'.$data['Name'].'</th>
        	<th><a href="#">Edit</a>|<a href="#">Delete</a><br>
'; } } } ?>
Manage Links Add New Link
<?[/CODE]

What am i doing wrong to get this to work can anyone help?

Thanks,William

Modern browsers don’t allow to copy to clipboard with javascript (for security reasons).
The only way is to use workaround with hidden flash object.
There is a library for that: http://zeroclipboard.org/

Of course anyone without flash enabled or with the parts of flash that relies on disabled will still be unable to copy to the clipboard.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.