adspace


Write a program to decode the data in the form using cgi programming

Answer Posted / Roop Singh Rana

Here is an example of a simple CGI (Common Gateway Interface) program that decodes data sent in the form of a URL-encoded string:
#!/usr/bin/perl
use CGI;
my $query = new CGI;
my $data = $query->param('data');
if (defined($data)) {
print "Content-type: text/plainnn";
print decode_uricomponent($data);
} else {
print "Content-type: text/htmlnn";
print "<html><body>Please enter some data to decode.</body></html>";
}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

There is no strict data types in perl unlike in other high level languages like Java so wouldn't that be a problem if a code in perl is to be a written by a big team of 20+ members ?"

2460


How do find the length of an array?

1216


How to connect to SQL server through Perl?

1148


What is perl? What is the basic command to print a string in perl?

944