Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

How to pass value/output of a CGI script to another CGI in its website entirety

by monkfan (Curate)
on Apr 25, 2007 at 07:21 UTC ( #611932=perlquestion: print w/ replies, xml ) Need Help??
monkfan has asked for the wisdom of the Perl Monks concerning the following question:

This website of mine does the following steps:
  • First session takes input from user
  • Second session shows the url where the user can download the results AND
  • button to pass the output results to another cgi of my Main website.
You can try the webapp just by using the default values (by just pressing SUBMIT button, nothing else).

Now what I am trying to achieve here is that: once the "RUN SPACE Button" is pressed, it should bring the user to this Main website with the output result paste into the FASTA text field.

The current system I had only bring us to the cgi script of my main website, without the decoration, etc. How can I make it appear in the Main website with the content pasted into it with CGI.pm?

Below is the portion of the code that fails to do the job. And the full code can be found here.
sub print_results { # Snipp---- # Accept job with specified parameter my $param = "perl search_gname_and_fasta.pl -gti $go_ti -s $org_ty +pes -o $outfile -du $seq_type -f $wstr -t $wend"; #print "$param\n"; print br; print "Please wait, this may take a few seconds.\n"; print br; print hr; system($param); print br; print "Thank you for submitting the job with us.\n"; print br; my $fasta = read_file($outfile); prn_run_space_button(param('organism'),$fasta); # I don't know how to achieve the above function # with CGI.pm #print start_multipart_form(), #print start_form(-method=>"POST", # -action=>"space_dispatch.cgi", # ); #hidden( -name=>"analysis", -value=>"Light"); #hidden( -name=>"organism", -value=>"S.cerevisiae"); #hidden( -name=>"sequence", -value=>$fasta); #submit( -name=>'action', -value => 'Run SPACE-1' ), #print endform; } sub prn_run_space_button { my ($orgname,$fname) = @_; # This snippet only brings us to the cgi # but not the Main website in its entirety # At this point I tried verbatim print the # htmls decoration according to main file. # But won't do. print qq(<FORM METHOD="POST" ACTION="space_dispatch.cgi">\n); print qq(<INPUT type="hidden" NAME="analysis" VALUE="Light">\n); print qq(<INPUT type="hidden" NAME="organism" VALUE=$orgname>\n); print qq(<INPUT type="hidden" NAME="sequence" VALUE="$fname" >\n); print qq(<INPUT type="submit" value="Run SPACE">\n); print qq(</FORM>\n); return ; }

Regards,
Edward

Comment on How to pass value/output of a CGI script to another CGI in its website entirety
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://611932]
Approved by andye
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (14)
As of 2014-12-18 13:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (51 votes), past polls