4D v16.3On Web Connection database method |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v16.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.
The request should have previously been 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 passed by 4D ($1, $2, $3, $4, $5, and $6). These parameters are described in the following table:
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 shown below:
` On Web Connection Database Method
C_TEXT($1;$2;$3;$4;$5;$6)
` Code for the method
Let’s use an intranet connection as an example. 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 |
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 uses this information, it is up to you to parse the header and the body.
Note: For performance reasons, the size of this data cannot be more than 32 KB. Beyond this, they are truncated by the 4D HTTP server.
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, etc.) 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 v16)
4D Language Reference ( 4D v16.1)
4D Language Reference ( 4D v16.2)
4D Language Reference ( 4D v16.3)