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
Write the program to process a list of numbers.
Explain the arguments for perl interpreter.
Explain strftime() function in perl?
What are the logical operators used for small scale operations? Explain them briefly.
Write a program to decode the data in the form using cgi programming
How do you turn on the perl warnings?
How we can navigate the xml documents?
How to dereference a reference?
you are required to replace a char in a string and store the number of replacements. How would you do that?
Explain the difference between die and exit in perl?
Explain 'grep' function.
Explain substr function in perl?
How to read a file into a hash array?
Explain chop?
List the prefix dereferencer in Perl.