Compatibility: 6.7.x and 6.8.x
The 4D Web server supports a special method called Compiler_Web that copies incoming HTML fields directly into 4D variables. For example, if an HTML form includes an input named First_Name_s with a value of George, the Compiler_Web method copies George into a 4D process variable named First_Name_s, if it exists. There are only a few rules to be aware of when using this convenient system:
- The 4D and Web variable names must match exactly.
- The variable names are not case sensitive.
- All 4D variables used in this manner must be declared in Compiler_Web.
- The values are copied just after Compiler_Web finishes. Therefore, Compiler_Web cannot test variable values directly.
The flow of events when a form is submitted is straightforward:
- The Compiler_Web method runs.
- The On Web Authentication database method runs.
- If the form was submitted with 4DACTION, the specified project method runs.
- If the form was submitted with 4DCGI, the On Web Connection database method runs.
The Compiler_Web method was originally designed for use with POST HTML form submission method but also supports GET. Compiler_Web was originally documented to support 4DACTION, but also supports 4DCGI. Below is a summary of these behaviors:
- Forms submitted with POST in 4D v6.5 and later.
- Forms submitted with GET in 4D v6.7 and later.