Hi

Thanks for your valuable support but still output is appearing in seperate
window instead of same window.
Please check by using CODE of "list.pl" in place "simple_form.pl"
*****
#!/perl/bin/perl -w
#multilist.pl
use strict;
my $mone;
my $mtwo;
my @days;
my $days;
($mone, $mtwo) = (1, 3);
print "Content-type: text/plain; charset=iso-8859-1\n\n";

print "Hi, This is test program on Apache Server.";

print (('one', 'two', 'three', 'four')[$mone, $mtwo]);
print "\n";
print ("one", "two", "three", "four");
print "\n";
print q/one two three four/;
print "\n";
print qq/one two three four/;
print "\n";
@days=(10, 20, 30, 40, 50);
print "Before: @days\n";
for (@days){$_*=2}
print "After: @days";

*****

Output should appear in same window.

----- Original Message ----- 
From: "Brian Raven" <[email protected]>
To: <[email protected]>
Sent: Tuesday, October 06, 2009 8:32 PM
Subject: RE: Using .cgi file as form action


> From: [email protected]
> [mailto:[email protected]] On Behalf Of
> Kprasad
> Sent: 06 October 2009 15:15
> To: [email protected]
> Subject: Using .cgi file as form action
>
>> Hi
>>
>> I'm using HTML form to execute a .cgi script and I want the output of
> cgi script should display in the same
>> window in which Form is displayed.
>>
>> Anyone can suggest that how to do it.
>
> I would have thought that the simplest way would be for the cgi program
> to output both the form, and when data is entered on the form, the
> output as well.
>
> This isn't really a Perl question, but as this is a Perl forum here is a
> simplistic example of what I mean.
>
> ------------------------------------------------------
> use strict;
> use warnings;
>
> use CGI::Pretty qw{:standard *form *select};
> use CGI::Carp qw{fatalsToBrowser};
>
> my @options = ("This", "That", "The other");
>
> my $sel = param("selection") || "";
>
> print header;
> print start_html("Simple form");
> output_form();
> output_data() if $sel ne "";
> print end_html;
>
> sub output_form {
>    print h1("This is a form");
>    print start_form({method => "post", action=>"simple_form.pl"});
>    print strong("Select something: ");
>    print Select({name => "selection"},
> map {option($_ eq $sel ? {selected => 1} : {}, $_)}
> @options);
>    print p();
>    print submit("Use that");
>    print end_form;
>    print hr();
> }
>
> sub output_data {
>    print h2("You selected something");
>    print "It was ", strong($sel);
> }
> ------------------------------------------------------
>
> HTH
>
> -- 
> Brian Raven
> This e-mail may contain confidential and/or privileged information. If you 
> are not the intended recipient or have received this e-mail in error, 
> please advise the sender immediately by reply e-mail and delete this 
> message and any attachments without retaining a copy.
>
> Any unauthorised copying, disclosure or distribution of the material in 
> this e-mail is strictly forbidden.
>
> _______________________________________________
> Perl-Win32-Users mailing list
> [email protected]
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
>
> 

_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to