The connection between the HTML document displayed by the browser and a CGI program on the server
chmod a+rx cgi-bin
#!/usr/bin/perl -w
<a href="cgi-bin/reply.pl"> Click here to run the CGI program, reply.pl </a>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 strict//EN" "http://www.w3.org/TR/xhtml1/dtd/xhtml1-strict.dtd"> <!-- reply.html A trivial document to call a simple CGI Perl program --> <html> <head> <title> HTML to call the CGI-Perl program reply.pl </title> </head> <body> <p> This is our first CGI-Perl example <br /><br /> <a href="http://personal.utulsa.edu/~diaz/cgi-bin/reply.pl"> Click here to run the CGI program, <tt>reply.pl</tt> </a> </p> </body> </html>
print "Content-type: text/html \n\n";
#!/usr/bin/perl -w # reply.pl - a CGI program that returns a greeting to the user print "Content-type: text/html \n\n", "<html><head> \n", "<title>reply.pl example </title></head> \n", "<body> \n", "<h1> Greetings from your Web server! <h1> \n", "</body></html> \n";