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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multipart CGI Forms?

Status
Not open for further replies.

higginsd

Programmer
Sep 26, 2000
5
US
I'm having some problems with a CGI program. Although this is a Perl forum, it seems to have more activity than the CGI-Bin forum. Please help.

1. HTML sends info to a CGI program.
2. CGI program reads in the data and generates new HTML
**here's the problem**
3. After the new HTML is generated by the CGI, changes are made to form data and then submitted, requiring a new HTML to be generated. I can't get this part to work unless I save the posted form data to a text file, launch a new cgi, read in the values, then create the next html. I'd like to be able to do this all from within the same cgi program.

TIA,

higginsd [sig][/sig]
 
As there are a zillion (well, at least more than one) way to generate the html you are mentioning, would you consider posting some of your perl code that generates it. Then some of us can get a better handle on what needs/might be able to be done.
 
Hi BobMCT,

I wish I could but the script and code is covered under an NDA (non-disclosure agreement). If it was not under the NDA I would have posted it when I first asked.

If you would be so kind as to display one or two of the many ways to do this, I would greatly appreciate it.

At present, the project is working fine but is pretty ugly. As each subsequent html & formdata is generated, it get's passed to a new cgi which interacts with Oracle, returns some data and reposts to a new html. Surprisingly, this appears to work very fast. (maybe I should just leave it alone?)

Thanks in advance,

higginsd [sig][/sig]
 
Without posting the actual code, could you post some psuedo code or something? [sig]<p>fortytwo<br><a href=mailto:will@hellacool.co.uk>will@hellacool.co.uk</a><br><a href= test site</a><br> [/sig]
 
Well, here's a simple shot:
The way form fields are delivered BACK into a cgi script is with one of two ways; they either come in from sysin or via a single variable called QUERYSTRING. In either case the values must be parsed out of the data stream with logic that you can locate on the CPAN site or on perl.com or perl.org. These routines should be executed at the beginning of your cgi scripts and will separate the data elements from their associated data names (hashes) so you can reference and reuse them. Once you have the routine it is generic and should work, without change, is all of your scrips.
Hope this helps.

ps: look for names like formsparse or forms, etc when searching the recommended sites.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top