HTML Output from CGI script

by on October 10th, 2007

Writing HTML in CGI script is pretty easy. Try the following CGI script.

#!/usr/bin/perl -wt
print <<htmlPrinting;
Content-type: text/html\n\n
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<table width="700" height="200" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center" bgcolor="#290000"><font color="#FFFFFF" face="Arial, Helvetica, sans-serif">My
first programme in CGI. </font></td>
</tr>
</table>
</body>
</html>
htmlPrinting
Share