I am returning values from a database search that are currently hyperlinked to redirect to search.php
. I would like to change my code so that instead of redirecting to search.php
, the text of the link will be copied to clipboard when the user clicks it with the mouse and the user will remain on the same page. An easy solution would be greatly appreciated. Here is the code I am currently using.
while($row = mysql_fetch_assoc($find_parts))
{
$name = $row['name'];
$id = $row['id'];
echo "<a href='search.php?id=$id'>$name</a><br />";
}
Basically all I want is for name
to be copied to clipboard when the link is clicked