Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to call another CGI in PERL 2

Status
Not open for further replies.

darkom

Programmer
Apr 14, 2000
28
CA
My CGI needs to call another CGI program without user intervention so my question is how can I do this ?<br><br>Is there a function or module that can do the job ?
 
Your question is quite vague.&nbsp;&nbsp;I can't give you a specific response.&nbsp;&nbsp;Maybe someone else sees more in the question than I do.<br>A piece of CGI is just like any other piece of PERL.&nbsp;&nbsp;If you want to call another program, just do it.&nbsp;&nbsp;See &quot;<b>backticks&quot;, &quot;system&quot;, and &quot;exec</b>&quot;ute funtions via<br>perldoc or on the web or in a book. <br>Or, ask here again with a little more detail.....like what is the second piece of code doing?&nbsp;&nbsp;&nbsp;Is it printing to the same client browser?&nbsp;&nbsp;Is it doing house keeping on the server?&nbsp;&nbsp;or What?&nbsp;&nbsp;Note that there are significant differences in how you use backticks and the system and exec functions.&nbsp;&nbsp;Be aware that making system calls of any sort in CGI stuff can create serious security issues (read problems).
 
Ok here it is: <br><br>I have a CGI program that displays a html page while it's doing some functions. The page says ONE MOMENT PLEASE !.<br>I would like to display another page when the functions are finished, that says OPERATION SUCCESFULL ! or a page that says THE FOLLOWING FUNCTIONS DID NOT WORK !.<br><br>By using EXEC(), to call the other page when the functions are finished, nothing happens.<br><br>I hope that it is clearer this time.
 
If the first script does everything you want it to (displays the message and then handles whatever functionality you want), you could just print a redirect statement after the final function exectues, to send the browser to a new page or CGI... since the page is already loaded, you could print javascript relocation code:<br><br>&lt;script langus=&quot;JavaScript&quot;&gt;<br>&nbsp;&nbsp;location.href=&quot;somenewscript.cgi&quot;<br>&lt;/script&gt;<br><br>...and that should forward the browser to the new cgi. if all you want is static text on that page, you may as well forward to an HTML document.<br><br>Hope this helps!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top