Insert PHP code in Text

A better, cleaner way to do this would be to use proper string return methods and concatenation. I say this, because you’re trying to put functions that echo content (i.e. the_title() into a variable – this won’t work!!!

Instead:

$text="<form><td>Permalink to: ";
$text .= get_the_title();
$text .='</td><textarea cols="85" rows="2" readonly="readonly" onclick="select()"/>';
$text .= get_permalink( $id );
$text .= '</textarea></form>';

Or, if you absolutely must have this in one long line:

$text="<form><td>Permalink to: " . get_the_title() . '</td><textarea cols="85" rows="2" readonly="readonly" onclick="select()"/>' . get_permalink( $id ) . '</textarea></form>';