?
Solved

Executing 2 CGIs with a single submit

Posted on 1998-12-14
4
Medium Priority
?
221 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 200 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

Stack Overflow Podcast - Developer Story

Welcome to the Stack Overflow podcast recorded Thursday July 20 at Stack Overflow Headquearters in NYC. Your hosts today are podcast regulars Jay Hanlon, David Fullerton, and Ilana Yitzhaki, plus the quite irregular Matt Sherman (Stack Overflow Engineering Manager extraordinaire)

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…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
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…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Suggested Courses

801 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