KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Root Syntax with URL's and Form Actions
PRODUCT: 4D | VERSION: 12.1 | PLATFORM: Mac & Win
Published On: April 7, 2011

When using the URL's and HTML form actions that the web server offers (including 4DACTION, 4DCGI, and 4DSYNC) it is important to use the root syntax of the URL. If you use a non-root syntax then there can be a chain of "4DCGI" or "4DACTION" strings when the URL is passed back to 4D's On Web Connection and On Web Authentication methods.

For example, see the form HTML below, using non-root notation:

<p><a href="4DCGI/return_a_page">4DCGI WITHOUT LEADING SLASH</a></p>

If the submit button for this HTML form is pressed repeatedly, you will see "4DCGI/4DCGI/4DCGI/return_a_page" in the URL parameter ($1) of On Web Connection.

If instead the root form is used, as shown below, the repetition problem is resolved:

<p><a href="/4DCGI/return_a_page">4DCGI LEADING SLASH</a></p>

In this case no matter how many times the button is clicked the On Web Connection database method will have the URL parameter shown as "/4DCGI/return_a_page".

The important character is the preceding "/" in the URL. The difference between "/4DCGI/return_a_page" and "4DCGI/return_a_page" can sometimes be very important. 4D is interpreting the "4DCGI" as a tag, and if there is no root notation then the tag is pre-pended to the next page served. To keep the reference, the tag is also prepended to the URL being sent to 4D.

For more information on this topic see the Design Reference at: URLs and Form Actions