Printing Html in CGI
by Hiroshi on October 10th, 2007
Examples of printing HTML in CGI scripts.
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;
Download Script
Topic: CGI, Tutorials
Tags: CGI, cgi print html, script
Post's RSS » RSS 2.0, Post's Comments RSS » RSS 2.0


