Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

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

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 -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 #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 ; }

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

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://611932]
Approved by andye
and the sunlight beams...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (8)
As of 2018-06-20 15:47 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (116 votes). Check out past polls.