We have a block containing the code:
<?php print token_replace('[current-page:url]'); ?>
which does most of what is needed, which is just to mirror the URL of a unique views page containing user-populated content. [The purpose is for sharing the user's list selections. But in this case, general "sharing" modules/functions are not appropriate and it's better to provide the URL for the user to copy into an email.]
As a useability improvement to make it easier to copy this URL, we want to generate a live-text field which has this value as its default content. What PHP code would do that?
Is is also possible to have that value (the resulting URL) automatically highlighted, so it's ready to copy? To go a step further, what would be required to add a "copy" button which would grab all of what's in the field, even if the URL is too long for full display?