Solved

Executing 2 CGIs with a single submit

Posted on 1998-12-14
4
215 Views
Last Modified: 2013-12-25
Is there a way to execute 2 CGIs (in sequence one after the other)with a single submit..
the idea is that when the user presses a 'SUBMIT' button, first one cgi gets executed and immeditely after that the second one should get executed ..

There are also a couple of parameters that need to be passed along to the second CGI that needs to be executed ..

this is how my page looks

<form name="Attachments" enctype="multipart/form-data" method="post" action="/scripts/FileUpload.exe" target="AttachBox" onsubmit="return check_fields()">
<input TYPE="file" NAME="FileName">
<br>
<br>
<input TYPE="submit" VALUE="Load file">
<INPUT TYPE=HIDDEN NAME=SESSION_ID VALUE=41913630474>
</form>

<!--when the user click on the Load file FileUpload.exe gets executed -->

<form ACTION="/scripts/NewCGI.exe" name="Sender" onsubmit="return test()" method="post">

<input type="hidden" name="x" value="x">
<INPUT TYPE=HIDDEN NAME=SESSION_ID VALUE=41913632675>
<INPUT TYPE=HIDDEN NAME=NAME VALUE=sanjay>
<input type="hidden" name="SUCCESS" value="/Edilohn/successfultransmissionpage.html">
<input type="hidden" name="FAILURE" value="/Edilohn/transmiterrorpage.html">
<input type="hidden" name="LOGOUT" value="/Edilohn/logout.html">
<input type="hidden" name="MESSAGE_TYPE" value="9">
<input TYPE="submit" VALUE="Send file">
/form>

<!--when the user click on the Send file NewCGi.exe gets executed -->
0
Comment
Question by:sanjaychopra
4 Comments
 
LVL 1

Expert Comment

by:flivauda
ID: 1830121
You can have one cgi do both functions. or you can have the first one call the second one and passover the information.

I think your best bet is to have one cgi program that processes both parts.  Let me know if you need any suggestions on how to do this
0
 

Expert Comment

by:gecap
ID: 1830122
It looks like both of your cgi's are win executables. I'd suggest installing perl on your machine and then writing a quick script calling both of these functions, passing them the parameters through the perl script. (I'm assuming you can't simply put the two programs together, for lack of a compiler or some other reason.)
0
 
LVL 8

Accepted Solution

by:
jhurst earned 100 total points
ID: 1830123
Have the first script send a <form> as part of its results.  The <form> would include the other parameters that you need as <input type=hidden...> and there would be a <body onLoad=document.formName.submit()> that would cause the second one to be invoked.
0
 

Expert Comment

by:govinda051198
ID: 1830124
I agree with flivauda. It is advisable to have only one CGI script for one submit not multiple. Above problem can be solved
by many ways like eval of the second one, but instead of having two <FORM> tag need to have only one. U can execute the second
CGI with input parameters using eval very easily. But eval is dangerous!.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial will discuss fancy secure registration forms, with AJAX technology support. In this article I assume you already know HTML and some JS. I will write the code using WhizBase Server Pages, so you need to know some basics in WBSP (you mig…
I hope you'll find this tutorial useful and interesting. So let's try to extend Tcl with a new package.  For anyone more deeply interested please check out the book "Practical Programming in Tcl and Tk". It's really one of the best written books abo…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question