I have created a CGI-based page,after entering all the
values in to the fields, How to get the output on the web
browser using Perl
Answer Posted / vipul dalwala
print "content-type: text/html\n\n";.
if ($ENV{’REQUEST_METHOD’} eq ’POST’) {
read(STDIN, $buffer, $ENV{’CONTENT_LENGTH’});
}
else {
$buffer = $ENV{’QUERY_STRING’};
}
@keyvaluepairs = split(/&/, $buffer);
foreach $pair (@keyvaluepairs) {
($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex
($1))/eg;
print $name . "=". $value ."<br>";
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
How do I sort a hash by the hash value?
Why aren't Perl's patterns regular expressions?
What does perl do in linux?
How many types of operators are used in the Perl?
What is automatic error handling in perl?
Write a cgi program to show the header part?
Explain ivalue?
What are the various uses of perl?
How are parameters passed to subroutines in perl?
How to prevent file truncation in perl?
Explain lists in perl?
Explain the arguments for perl interpreter.
What does delete function do in perl?
How many types of variable in perl?
How to concatenate strings with perl?