Exercise Three 

Exercise Three
  • Okay, let's try to use perl to print out an HTML form! 
  • Here is the form you will try to output...
[Example]
  • Here is the code... 
  • #!/usr/local/bin/perl
    print "Content-type: text/html\n\n";
    print qq!
      <HTML>
      <HEAD>
      <TITLE>Testing Form Input</TITLE>
      </HEAD>
      <BODY>
      <FORM METHOD = "POST" ACTION = "fp.cgi">
      <CENTER>
      <TABLE BORDER = "1">
      <TR>
      <TH>First Name</TH>
      <TD><INPUT TYPE = "text" 
                    NAME = "f_name"></TD>
      </TR>
    
      <TR>
      <TH>Last Name</TH>
      <TD><INPUT TYPE = "text" 
                    NAME = "l_name"></TD>
      </TR>
    
      <TR>
      <TH>Email</TH>
      <TD><INPUT TYPE = "text" 
                    NAME = "email"></TD>
      </TR>
    
      </TABLE>
      <P>
      <INPUT TYPE = "SUBMIT">
      </CENTER>
      </FORM>
      </BODY>
      </HTML>!;
Formatting the Output
Table of Contents
Perl Scalars


Graphics & Media Lab. >> Библиотека | Курсы | Графикон

Hosted by Graphics & Media Lab
http://graphics.cs.msu.su
lab_logo
mailto: Laboratory