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



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

Answer / 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

More CGI Perl Interview Questions

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

4 Answers  


How will you access an element of a perl array?

1 Answers  


How many ways can we express string in Perl?

1 Answers  


what is Perl one liner?

1 Answers  


What are the advantages of programming in perl?

1 Answers  


Define perl scripting?

1 Answers  


Explain the functioning of conditional structures in perl.

1 Answers  


What is it meants by '$_'?

1 Answers  


How many types of primary data structures in Perl and what do they mean?

1 Answers  


How do you set environment variables in perl?

1 Answers  


How do you find the length of an array?

1 Answers  


Explain the meaning of perl one-liner?

1 Answers  


Categories