sorry about that, I forgot to add that to the field1 and field2 values into the form's text fields.
Try this for the form part...
<form name="somename" action="post">
<input type="hidden" name="field1" value="<?=$field1?>">
<input type="hidden" name="field2" value="<?=$field2?>">
<input type="text" name="field1" value="<?=$field1?>"><br />
<input type="text" name="field2" value="<?=$field2?>"><br />
Also <?=$variable?> should work. I don't now how long PHP has had that shortcut but I've been using if forever.
not "<?php =$field1>"> like you just typed but "<?=$field1?>
<?= is a shortcut for <?PHP echo
you never need to put the PHP in there unless for some odd reason you have two languages parsing the script.
Good luck.