Printing Html in CGI
October 10th, 2007 | by
Hiroshi | Posted in »
CGI
Simple html output from cgi script
#!/usr/bin/perl -wt
print “Content-type: text/html\n\n”;
print “<html><head><title>Hello World</title></head>\n”;
print “<body>\n”;
print “<h2>Hello, world!</h2>\n”;
print “</body></html>\n”;
HTML in CGI Second Example
#!/usr/bin/perl -wt
print “Content-type: text/html\n\n”;
print <<EndOfHTML;
<html><head><title>Test Page</title></head>
<body>
<h2>Hello, world! This is cgi and html printing</h2>
</body></html>
EndOfHTML
print end_html;


