On a totally unrelated note: My god, is that ugly code!
If I see this right there's only a single piece of real PHP in it:
putting the variable in the action field. For the rest: Leave PHP an use
pure HTML. Or use a decent form toolkit. like PEAR's HTML_Quickform.
There's no point in tons of print-commands just putting out hardcoded
strings.