[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 223
  • Last Modified:

Executing 2 CGIs with a single submit

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
sanjaychopra
Asked:
sanjaychopra
1 Solution
 
flivaudaCommented:
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
 
gecapCommented:
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
 
jhurstCommented:
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
 
govinda051198Commented:
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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now