in reply to Getting CGI parameters.
So you need to set up forms which the remote user can fill in and send to the web server, which will relay it to your app. Now you can manually make your forms, or you can generate them dynamically with CGI.pm or with here-documents. I prefer to use here-docs myself. Here is a little cgi program which will display your form variables for testing.
#!/usr/bin/perl use warnings; use strict; use CGI; my $cgi=new CGI; my %in = $cgi->Vars(); print "Content-type: text/html\n\n"; foreach my $key (keys %in){ print "$key -> $in{$key}<br>"; }
Now you takes those form variables, process them with your application, and send them back out to apache, which relays them to the user's browser. You can display them anyways you like, from a simple text output, to a fancy html table. The output format can be generated manually( with here-docs) or you can use CGI.pm's features to generate output. The important thing is to observe the protocols for generating the right type of "header" so that apache will send it, and it will look like you want. The more advanced users will recommend using a templating system for producing your output, like HTML::Template.
Generally, apache will accept your output if you start your script with the standard header:
thenprint "Content-type: text/html\n\n";
Remember that the browser expects <br> instead of \n.print 'here is all your output<br>'; print $output;
|
|---|