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

Delphi 6, Web Server Application (CGI), Multi-Actions

Status
Not open for further replies.

Celetron

Programmer
Sep 18, 2002
4
GR
I am trying to build a server side program using Delphi 6. The program has two parts: 1st to evaluate a form and 2nd if the form is valid to proceed with emailing the form's information.
Is it possible to build it in two different actions (let say "Evaluate" and "EmailForm") and connect these actions in such way that the email part is running only when the form is valid?

Many thanks in advance for you answer
 
Celetron,

You'd probably get more specific answers by posting your question in the Delphi forum. In traditional CGI applications, you can choose from a number of different techniques to accomplish this:

-- You create an HTML form with multiple Submit buttons with different values and then evaluate the submitted value to determine the action selected by the end-user.

-- You can use cookies, provide the user is using an appropriately enabled browser.

-- You have a HIDDEN field that gets set to different values, based on the current "state."

In general, there's usually an environmental test you can make to determine which action is appropriate. When you're devising this, however, keep security in mind, for there are several ways to defeat each commonly-suggested technique. A lot depends on the sensitivity of the application and the data you're collecting.

(One big tip, though, is to not accept the target email address from your HTML forms; otherwise, you may find spammers using your application to send out their, um..."stuff." It happens more often than many people realize.)

Now, I'm afraid I've not created a web application in Delphi, so I can't provide a specific example, however, it looks as if demonstrates several techniques you might find useful.

(Note that this is a sample article from a really terrific Delphi magazine. It's a bit pricey for those of us in the U.S., but well worth the investment, imho, for it covers a variety of things...including stuff that usually doesn't get covered in the traditional Delphi information sources.)

If you don't mind reading examples written in other languages, you may also find and helpful. Don't worry if you're not familiar with Perl, just read the source and try to see how the structure of these examples work. That should give you some additional ideas on how to manage the process.

Hope this helps...

-- Lance
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top