I'm not quite sure what the question really was. However, header() obviously has nothing to do with this at all.
A header is a string sent to the browser before any html output, to e.g. change cache-settings for this particular page, or to redirect the browser to another page (and a bunch of other stuff).
However, your question was "how to populate textboxes with the value of a variable". You are quite correct with the VALUE="..", however there is one mistake.
<input type="text" name="test" value="test">
would create a textbox with name and value set to "test". I think this is what you want?
<input type="text" name="test" value="<?php $test ?>"> .. ? This would be approx the same as
<?php
$temp
$test
$what
?>
Wich is some pretty useless php code 😉 It would either not output anything, or cause a parse error (I have never tried so I don't know😉.. What you want to do is to PRINT the value of $test, so that it actually gets sent to the remote web-browser.
try using <? echo $test; ?> or <? print $test; ?>. Note that for textareas, you'd do:
<textarea name="test"><? echo $test; ?></textarea>
:]