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

“The methods defined in the parent class will always override the methods defined in the base class”. What does this statement means?

1002


Explain subroutine?

910


What is lexical variable in perl?

924


What are numeric operators in perl?

946


What is subroutine in perl?

939


How do I replace every TAB character in a file with a comma?

957


what is CPAN?

969


For a situation in programming, how can you determine that Perl is a suitable?

878


What is perl unshift array function?

1025


If you want to empty an array then how would you do that?

1090


What are some of the key features of objects in perl?

936


Mention how many ways you can express string in Perl?

1006


Explain cpan?

968


What interface used in PERL to connect to database? How do you connect to database in Perl?

984


What does perl do in linux?

936