Log In    |    Knowledge Base    |    4D Home
Tech Tip: What happens when submitting HTML Forms
Published On: August 3, 2001
Your current browser may not allow you to download the asset. We recommend Mozilla Firefox or Google Chrome.
Log In

When you submit the contents of an HTML form to 4D's Web Server, you do so by setting the "action" of the <form> tag:

<form name="form_name" method="post" action="/4dcgi/form_handle">

- or -

<form name="form_name" method="post" action="/4daction/form_handle">

What does 4D do when it receives this form? The first thing that happens is that the COMPILER_WEB method will execute, if it exists. This method should be used to declare variables that may be used to accept data automatically from like-named HTML form items. For instance, if you had this in your HTML form:

<input type="text" name="tWebVar" value="Data from the Web">

And you had the following line in COMPILER_WEB:


Then _after_ COMPILER_WEB executes the tWebVar variable in 4D would have "Data from the Web" as its value.

After COMPILER_WEB Executes, the "On Web Authentication" database method will execute, followed by either "On Web Connection" (for use with /4dcgi/) or the method specified for use with /4daction/.

It is also always a good idea to initialize your form variables in COMPILER_WEB, to make sure you only get the values from the current form submission and not any previous values in case the process is being reused by 4D.