Solved

Executing 2 CGIs with a single submit

Posted on 1998-12-14
4
212 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

In this tutorial I will focus on how to use WhizBase as a tool for sending ICQ messages to ICQ. Here I will use a new technology in WhizBase, published in WhizBase 5.1 version. In this tutorial I will use 3 files, pager.wbsp for the processing, e…
Recently I have been answering a lot of questions like this in IT forums that I frequent. The question posed is usually something along the lines of "We have software X installed and need to uninstall it for reason Y" or some other variant of the sa…
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
The viewer will learn how to dynamically set the form action using jQuery.

728 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now