You need to print a content-type line to tell the browser it's HTML, and you need to print real HTML. I don't remember exactly what it should look like off hand, but ...
The CGI (Common Gateway Interface) defines a way for a web server to interact with external content-generating programs, which are often referred to as CGI programs or CGI scripts. It is the simplest, ...