Running a Perl cgi program |
The html to prompt for your name looks like this <!DOCTYPE html> <html> <body> <FORM ACTION="/cgi-bin/hello-perl.cgi" METHOD="POST"> <label><b>Please enter your name</b></label> <INPUT TYPE="text" NAME="name" SIZE=30 > <input type="submit" value="Submit" /> </form> </body> </html> Note: you can also use javascript to prompt for the name rather than a form See Javascript example1 The Perl cgi code on the server looks like this #!/usr/bin/perl -w use CGI qw(:standard); use strict; my $query = new CGI; my $name = $query->param("name"); print $query->header("text/plain"); print "Hello $name \n"; |
|