in reply to Re^2: html input value
in thread html input value

See CGI 101 which has simple examples. Your original code prints output before header which is no doubt going to cause you problems.