oh sorry i read the originally post wrong i saw the table and thought he was wanting the variable in html don't know why I ignored the echo. I decided to test this here
http://www.goolefitc.co.uk/test_brackets.php and it works great good tip Tamlin.
Alternative method below (think i may be switching to squiggly brackets tho!)
echo '<tr><td><label>Enter Student Number or Username<br />
<input name="uid" type="text" id="uid" value="'.$name2.'" /></td></tr>';