magazine resources subscribe about advertising

New Architect Daily
Commentary and updates on current events and technologies

CMP Media E-Book

Download your copy today.

Research
Search for reports and white papers from industry vendors and analysts.

This Week at NewArchitect.com Subscribe now to our free email newsletter and get notified when the site is updated with new articles







Day of Defeat Online Gaming

 New Architect > Archives > 1999 > 06 > Programming with Perl

Processing CGI Forms Remotely

Randal L. Schwartz

CGI programs permit the Web surfer to perform actions affecting the state of things on the Web server. In many cases, the Web server machine is also where the neat stuff lives, so that the CGI script has direct access to files, processes, and databases to fully respond to a request.

But sometimes the request needs to be shipped off from the machine that's supposed to handle the CGI query to a machine that can actually handle the query. For example, if you rent space on a virtual server to handle your customers' page-fetching activities, and also have CGI scripts to let them ask questions or order products, it's possible that the order-entry system actually lives at another machine not directly accessible to the CGI scripts. How do we let the CGI system access the order-entry system?

Well, one way is to let the CGI script perform the normal data-entry validation -- retrying the form until the data is correct as far as can be determined without connecting with the order-entry system -- and then bundle up a mail message to the order-entry system. This mail message contains all the parameters, so that the order-entry system can effectively "process the form," albeit remotely.

Now, there's nothing terribly tricky about this, until you start considering that form data might be tricky to flatten out into a mail message that survives one or more hops through potentially hostile mail systems.




  Day of Defeat Online Gaming

home | daily | current issue | archives | features | critical decisions | case studies | expert opinion | reviews | access | industry events | newsletter | research | careers | info centers | advertising | subscribe | subscriber service | editorial calendar | press | contacts


Copyright © 2006 CMP Media, LLC Read our privacy policy, your California privacy rights, terms of service.
SDMG Web sites: BYTE.com, C/C++ Users Journal, Developer Pipeline, Dr. Dobb's Journal, DotNetJunkies, MSDN Magazine, Sys Admin,
SD Expo, SD Magazine, SqlJunkies, The Perl Journal, Unixreview, Windows Developer Network, New Architect

web2