ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Web-specific functions / Browser functions
  • Accepting (or not) the return address
  • Server IP address
  • Pre-launched sessions
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Returns the IP address of the client computer connected to the WEBDEV website.
Remark: If the Web user is behind a router, the IP address will be the one of the router.
To get this information from a web service, use WebserviceClientIPAddress.
Example
// Returns the IP address of the Web user
sClientAddress is string = BrowserIPAddress()
Syntax
<Result> = BrowserIPAddress([<Accept return address>])
<Result>: Character string
IP address of the computer of the Web user:
  • in IPv4 format: xxx.xxx.xxx.xxx. For example: 195.196.100.1
  • in IPv6 format: xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx
<Accept return address>: Optional boolean
  • True to accept the initial address specified in the HTTP header,
  • False (default) to refuse this address. In this last case, the IP address is retrieved in the environment variable (REMOTE_ADDR) defined by the Web server.
By default, the address specified in the HTTP header is rejected for security reasons.
PHP This parameter is not supported.
Remarks
WEBDEV - Server codeWindowsLinux

Accepting (or not) the return address

The address returned by the BrowserIPAddress function may not correspond to the Internet user's address (e.g. if a non-transparent proxy or Load Balancer is used).. In this case, BrowserIPAddress returns the IP address of the proxy or Load Balancer.
If the return address is accepted, BrowserIPAddress tries to read the original address specified in the HTTP headers (most proxies provide the original address in the HTTP headers). However, this address must be used with caution because it is not reliable and can be completely wrong.
Notes:
  • If the user passes through several proxies, several addresses can be returned.. In this case, the list of recovered IP addresses is of the form:
    Internet user IP, Proxy 1 IP, ..., Proxy N IP
  • If the original address is not found or is invalid (too long for example), the "standard" address is sent.
  • In test mode, BrowserIPAddress returns the address of the development computer.

Server IP address

The server IP address is returned by NetIPAddress.

Pre-launched sessions

If your project uses pre-launched sessions, this function must not be used in the project initialization event. This function must be used in the "Initialization in pre-launched session mode" event.
Business / UI classification: Neutral code
Component: wd300page.dll
Minimum version required
  • Version 9
Comments
Click [Add] to post a comment

Last update: 09/30/2024

Send a report | Local help