Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Which functions in perl allows you to include a module file. State their differences.

945


What does the’$_’ symbol mean?

1007


What is the peculiarity of returning values by subroutines in perl?

913


What does a die() function do in perl?

977


Explain join function in perl?

957


What is the use of "stderr()"?

1018


What is the purpose of goto expr statement?

916


Explain subroutine in perl?

940


Which functions in perl allows you to include a module file.

995


Explain perl. When do you use perl for programming?

876


Explain goto label, goto name, and goto expr?

923


Write syntax to use grep function?

970


What is q (single q) operator in perl?

1093


There are two types of eval statements i.e. Eval expr and eval block. Explain them.

1031


What does read () command do?

930