When the solution matters

Tips...

Registration Documentation Knowledgebase Seminars / Training Technical Support Partner Central

WebForms

Once again back in 4D's Design environment, you should bring up the 4D Explorer. You can do this easily just by hitting Control-spacebar (or Command-spacebar, on Macintosh). Alternatively, you can go to the Tools menu and choose "Explorer." When you have brought up the Explorer, click on the "Methods" tab. Expand the Database Methods and click on On Web Connection:

screenshot

You can double-click "On Web Connection" or you can highlight it and click the Edit button. When you do, you will be presented with a quick choice to make:

screenshot


Any time you are presented with this, you should always choose the default: Listing. 4D supports creating simple methods using a logical Flowchart, but this won't be used in the tutorials.

You should type (or copy-and-paste) the following into the On Web Connection method:

C_TEXT($1;$2;$3;$4;$5;$6)
C_TEXT($tURL)

$tURL:=$1

Case of
:($tURL="/")
SEND HTML FILE("index.html")
End case

screenshot

Your On Web Connection method should look like the one above. Yours is probably in black and white, but you can add colour to it by going to the colour menu (choose "Commands" from the sub-menu and choose the medium blue color from the palette to make your screen look like this one).

What is the On Web Connection method? It is a special script (or program) that executes when:

In the above example of On Web Connection, we are doing a simple check of the URL. If the requested URL is "/" (the root of the site), then we are going to reply by sending the "index.html" file via the SEND HTML FILE command. SEND HTML FILE takes a file path relative to the HTML Root (specified in the database properties).

Before proceeding, please close the On Web Connection. It will automatically be saved.

 Previous Step  1 2 3 4 5 6 7 8 9 10 11 Next Step


International | Company | Contact 4D | Site Map | Privacy Policy | © 4D UK 1995-2008 | Change font size: [A] [A] [A] | Print this page