Charlene Gentle wrote:
Hi
Hello,
I would like to know what is the best method and how to use it.
I recommend using the CGI module, see search.cpan.org and look for CGI
I have a html page with a question. The user submit the question. I
want the answer to be sent to a perl script that test it for stuff, and
the the perl script must send the result back to the html. The html
must display the result.
How can I get that done. Do I have to use cgi or php?
You can use either. In my experience PHP is more problematic than its worth.
How does it look, can anyone please give me an exsample.
#!/usr/bin/perl
use strict; use warnings; use CGI qw(header param url);
my $self = url(relative=>1);
print header();
if(param('action') eq 'process') {
my $greet = param('greeting'); print "<b>Say $greet Graci</b>\n";
} else {
print <<HTML;
<form action="$self" method="post"> <input type="hidden" name="action" value="process" /> <input type="text" name="greeting" /> <input type="submit" value="Say Hello" /> </form>
HTML
}
HTH :) Lee.M - JupiterHost.Net
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>