4D v14.3On Web Connection database method |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v14.3
On Web Connection database method
|
$1, $2, $3, $4, $5, $6 -> On Web Connection database method | ||||||||
Parameter | Type | Description | ||||||
$1 | Text |
![]() |
URL | |||||
$2 | Text |
![]() |
HTTP header + HTTP body | |||||
$3 | Text |
![]() |
IP address of browser | |||||
$4 | Text |
![]() |
IP address of the server | |||||
$5 | Text |
![]() |
User name | |||||
$6 | Text |
![]() |
Password | |||||
The On Web Connection database method can be called in the following cases:
For more information, refer to the paragraph “On Web Connection Database Method calls” below.
Compatibility note: The database method is also called when a context is created in contextual mode (obsolete mode that could be used in converted 4D databases).
The request should have been previously accepted by the On Web Authentication database method (if it exists) and the Web server must be launched.
The On Web Connection database method receives six text parameters that are passed by 4D. The contents of these parameters are as follows:
Parameters | Type | Description |
$1 | Text | URL |
$2 | Text | HTTP header + HTTP body (up to 32 kb limit) |
$3 | Text | IP address of the Web client (browser) |
$4 | Text | IP address of the server |
$5 | Text | User name |
$6 | Text | Password |
You must declare these parameters as follows:
` On Web Connection Database Method
C_TEXT($1;$2;$3;$4;$5;$6)
` Code for the method
The first parameter ($1) is the URL entered by the user in the location area of his or her Web browser, from which the host address has been removed.
Let’s take the example of an Intranet connection. Suppose that the IP address of your 4D Web Server machine is 123.4.567.89. The following table shows the values of $1 depending on the URL entered in the Web browser:
URL entered in Web browser Location area | Value of parameter $1 |
123.4.567.89 | / |
http://123.4.567.89 | / |
123.4.567.89/Customers | /Customers |
http://123.4.567.89/Customers | /Customers |
http://123.4.567.89/Customers/Add | /Customers/Add |
123.4.567.89/Do_This/If_OK/Do_That | /Do_This/If_OK/Do_That |
WARNING: In order to prevent a user from reentering a database with a bookmark created during a previous session, 4D intercepts any URL that corresponds to one of the standard 4D URLs.
With Safari running on Mac OS, you may receive a header similar to this:
GET /favicon.ico HTTP/1.1
Referer: http://123.45.67.89/4dcgi/test
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; fr-fr) AppleWebKit/523.10.3 (KHTML, like Gecko) Version/3.0.4 Safari/523.10
Cache-Control: max-age=0
Accept: */*
Accept-Language: fr-fr
Accept-Encoding: gzip, deflate
Connection: keep-alive
Host: 123.45.67.89
With Microsoft Internet Explorer 8 running on Windows, you may receive a header similar to this:
GET / HTTP/1.1
Accept: image/jpeg, application/x-ms-application, image/gif, application/xaml+xml, image/pjpeg, application/x-ms-xbap, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, */*
Accept-Language: fr-FR
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C)
Accept-Encoding: gzip, deflate
Host: 123.45.67.89
Connection: Keep-Alive
If your application deals with this information, it is up to you to parse the header and the body.
Note: For performance reasons, the size of these data cannot be more than 32 KB. Beyond this, they are truncated by the 4D HTTP server.
Note: If the user name sent by the browser exists in 4D, the $6 parameter (the user’s password) is not returned for security reasons.
The On Web Connection database method can be used as the entry point for the 4D Web server, either using the special 4DCGI URL, or using customized command URLs.
Warning: Calling a 4D command that displays an interface element (DIALOG, ALERT...) ends the method processing.
The On Web Connection database method is therefore called in the following cases:
(*) In this particular cases, the URL received in $1 does NOT start with the "/" character.
Product: 4D
Theme: Database Methods
4D Language Reference ( 4D v14 R3)
4D Language Reference ( 4D v14 R2)
4D Language Reference ( 4D v13.5)
4D Language Reference ( 4D v14.3)
4D Language Reference ( 4D v14 R4)
Inherited from : On Web Connection Database Method ( 4D v12.4)