简体   繁体   中英

How to call a perl cgi script from another perl cgi script

I have a html form ... While submitting that form, I am calling one Perl CGI Script, that will save the data in MYSQL database.

After saving the data in databse, i want to reopen the same page with all empty fields in form, means i want too reload the same form again.

How can i achieve this? or what should i call in my script so that i can come back to same form again.

Remember i am generating the forms using template and perl script..

Thanks in advance

Is this second program really a CGI program? I mean does it accept parameters from a HTTP request and return it's results in an HTTP response?

If that's the case then you can call it using libraries from the LWP CPAN distribution.

If your second program is actually just a command program then you can call it using system .

You can redirect using HTML's meta refresh or by using JavaScript's window.location object. Have the CGI script output any of those.

Another way is to have the CGI script output a redirect header. You can use CGI 's redirect method for this, or output it manually.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM