CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Intermediate:
Can anybody tell me?



Oct 19, 2001, 5:05 PM

Post #1 of 4 (791 views)
Can anybody tell me? Can't Post

How many scripts many be needed to process more than one forms like, if according to the result of one form, the other one has to be created, how many scripts have to be written to process them? Whether the number of forms depend on the number of scripts? Tell me the easier way of handiling this.


Oct 19, 2001, 6:08 PM

Post #2 of 4 (789 views)
Re: Can anybody tell me? [In reply to] Can't Post

If the question is:

Can a single script handle input from different forms and respond accordingly?

Then the answer is yes. By using input type "hidden" in your forms, you can pass a value to your cgi script indicating which form called the script.

if(param('action') eq "calculate"){ calc_mort(); }

if(param('action') eq "add_guest"){ add_guests(); }

... and so on.


Oct 21, 2001, 6:48 PM

Post #3 of 4 (780 views)
Re: Can anybody tell me? [In reply to] Can't Post

This will be a good solution when there are particular forms are existing. But if the forms have to be created depending upon the results got from the previous form on the fly, this solution mat not be the right one. So in such cases, mainly when the database query is also involved, what have to be done?


Oct 22, 2001, 2:25 AM

Post #4 of 4 (774 views)
Re: Can anybody tell me? [In reply to] Can't Post

for what he is asking I think the most logical choice would be to create both a form and script to handle it on the fly.

You *could* append the original script with subroutines and the if statement to call them, but what you would end up doing is slowing the script down more and more each time you appended to it.

PerlCoders CGI Supersite


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives