Solved

Executing 2 CGIs with a single submit

Posted on 1998-12-14
4
220 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

If you get a (Blue Screen of Death), your system writes a small file called a minidump. Your first step is to make certain your computer is setup to record memory dumps. Right click My Computer, choose properties. Click on the advanced tab, an…
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 if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

729 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