Variables can be incorporated into HTML or XML documents as an HTML or XML element.
All documents parsed in HTML or XML format, i.e. with file extensions
.htm/.html or
.xml/.jnlp
respectively (for Java Web Start) are parsed. The NetPhantom Variables have the format in HTML:
<@variable@>
or in XML:
<np-var value="variable"/>
where the variable is listed in the tables below.
When another HTML or XML element contains attributes, variable substitution is performed in these strings, e.g. in HTML:
<applet codebase="@**FULLSRVNAME@"...
<form method="POST" action="@**FULLSRVNAME@/mailform.cgi">
would perhaps be substituted to:
<applet codebase="https://netphantom.com:8443"...
<form method="POST" action="http://123.456.789.0/mailform.cgi">
before the document is sent to the requesting client. The same applies for XML documents, e.g.:
<icon href="@**FULLSRVNAME@/mydir/mybitmap.jpg"/>
could be substituted to:
<icon href="http://netphantom.com/mydir/mybitmap.jpg"/>
Variable substitution is also performed in e.g. JavaScript and can be very useful when e.g. setting focus
(using the @**FOCUS@ variable) in a form.
See the tables below for valid variables.
<@**DATE@>
Current date in long format.
| 2024-11-17 |
<@**TIME@>
Current time in long format.
| 08:19:25 |
<@**UTC@>
Current date and time in Universal Time Convention (UTC) format.
| Sun, 17 Nov 2024 08:19:25 GMT |
<@**MODDATE@>
The current resource last changed date in long format.
| 2019-09-15 |
<@**MODUTC@>
The current resource last changed date and time in Universal Time Convention (UTC) format.
| Sun, 15 Sep 2019 06:30:46 GMT |
<@**PROGDIR@>
Phantom directory.
| . |
<@**PROGVER@>
Phantom program version string.
| NetPhantom Version 7.70 (Build 8767) |
<@**PROGBUILD@>
The program version in the format 1.23 (Build 456).
| 7.70 (Build 8767) |
<@**PROGVER2@>
The program version according to HTTP standard product comment, e.g. NetPhantom/1.23 (Build 456) Java/1.2.3.
| NetPhantom/7.70 (Build 8767) Java/23.0.1 |
<@**OSVER@>
Operating System version.
| 5.14.0-427.42.1.el9_4.x86_64 |
<@**OSNAME@>
Operating System name.
| Linux |
<@**JAVAVER@>
Java version.
| 23.0.1 |
<@**JAVAVENDOR@>
Java vendor.
| Eclipse Adoptium |
<@**PROGNAME@>
Phantom exe file name (without extension).
| NetPhantom.class |
<@**CABVERSION@>
The NetPhantom version in the "CAB" format, i.e. major, minor1, minor2, number, e.g. "1,2,3,456" for Version 1.23 (Build 456).
| 7,7,0,8767 |
<@**AGENT@>
The user agent of the requesting client, i.e. the browser name and version.
| Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com) |
<@**ERRCODE@>
The current error code of the HTTP request/reply. A value of zero indicates that nothing has been sent to the client yet and no error has occurred. Otherwise this value is 200 (HTTP OK).
| 200 |
<@**ERRTEXT@>
The current error text of the HTTP request/reply or empty string for no error.
| OK |
<@**ERREXTRA@>
Extra error information available for certain error codes.
|
|
<@**CLIENTPORT@>
The client port number.
| 46796 |
<@**CLIENTADDR@>
The client host address.
| 3.138.116.1 |
<@**CLIENTNAME@>
host name of the client or the IP address as nnn.mmm.ooo.ppp if none is found.
| 3.138.116.1 |
<@**SERVERPORT@>
The port of the server that the client is accessing.
| 443 |
<@**CTRLSERVERPORT@>
The port of the controller server that the client is accessing.
This is used for Load Balancing.
| 443 |
<@**SERVERADDR@>
The host address of the server.
| 92.205.27.238 |
<@**SERVERNAME@>
The host name of the server or the IP address as nnn.mmm.ooo.ppp if none is found.
| www.netphantom.com |
<@**CTRLSERVERNAME@>
The host name of the server or the IP address as nnn.mmm.ooo.ppp if none is found of the controller server.
This is used for Load Balancing.
| www.netphantom.com |
<@**ADMINPORT@>
The port of the server used for remote administration, e.g. the command line utilities.
| 1790 |
<@**FULLSRVNAME@>
The full server name including the protocol, i.e. http[s]://fullsrvname.
| https://www.netphantom.com |
<@**FULLCTRLSRVNAME@>
The full server name of the controller server including the protocol. This is used for Load Balancing.
| https://www.netphantom.com |
<@**HTTPMETHOD@>
The method used to handle the request (GET or PUT).
| GET |
<@**PROTOCOL@>
The protocol used (evaluates to http or https).
| https |
<@**URI@>
The Uniform Request Identifier for the resource last requested by the client.
| /info/HTMLvariables.html |
<@**URIPARAMS@>
The Uniform Request Identifier parameters for the last requested by the client. This
string is specified after '?' of the resource string.
|
|
<@**SSLLEVELindex@>
The data encryption level of SSL being used. Evaluates to an empty string if no SSL is used.
|
1: 1
2: 1
3: 256
4: TLS AES 256 GCM SHA384 |
<@**SSLSTRING@>
Evaluates to SSL if the connection is using SSL, otherwise to empty string. This variable is useful to specify the name of the client CAB or JAR file, e.g. "NetPhantomClient @**SSLSTRING@.cab".
| SSL
|
<@**SSLUSE@>
Evaluates to 1 (one) if this is a SSL connection to the client or 0 (zero) if not, typically used with NetPhantom Client parameter
<param name="SSL" value="@**SSLUSE@">.
| 1
|
<@#HTTPVariable@>
Evaluates to an HTTP user variable named HTTPVariable that certain CGIs create, update and/or use. See the Java class se.entra.phantom. server.http.HttpSession for more information.
The variable text is converted into HTML valid text.
|
|
<@#-HTTPVariable@>
Evaluates to an HTTP user variable named HTTPVariable that certain CGIs create, update and/or use. See the Java class se.entra.phantom. server.http.HttpSession for more information.
The variable text is used unchanged, i.e. it can contain HTML tags that will
be placed in the final document.
|
|
<@HostField[:LineNumber]@>
Inserts the contents of a host field. Optionally specify an index (one-based) of the line in the host field.
|
<@%HostField[:LineNumber]@>
Runs the contents of a host field through the translation table and inserts the result. Optionally specify
an index (one-based) of the line in the host field.
|
<@*TextID@>
References a text string in the text file (.PHM) with ID TextID.
|
<@-ControlID@>
References a text string of the ControlID. See Control ID References in
the Phantom User's Guide and Reference.
|
<@-ControlID:[x][.y]@>
References a text string of the ControlID that must be a list box, a combo box or
a spin button. The x and y parameters reference the column and line in the list box.
If the y parameter is omitted, i.e. ControlID:X, the text string is taken from the
list of the combo box or the spin button. If the x parameter is omitted, i.e. ControlID:.Y,
the text is taken from the header of the list box at column y. Both the x and y
parameters are one-based (e.g. first line = 1).
|
<@=GlobalVariable@>
The contents of a NetPhantom global variable.
|
<@**FOCUS@>
Returns the Control ID of the NetPhantom control that currently has focus. This is used
for setting focus via JavaScript to the correct control in an HTML page.
|
<@**MW@>
Message Waiting, 5250 only. 1 if MW flag is on in the OIA, otherwise 0.
|
<@**PANELID@>
The ID of the panel that caused the display of the HTML document.
|
<@**SCRID@>
The ID of the current screen.
|
<@**RTCRT@>
Timestamp of the runtime file (.PHR).
|
<@**APPDIR@>
Application directory.
|
<@**APPNAME@>
Application name (.PHR or .PHA file without extension).
|
<@**CLIENTID@>
The client session identifier.
|
<@**APPACTION@>
Contains the base of an HTTP hyperlink for an application. It consists of the protocol (HTTP or HTTPS),
the server name or address, optionally a port number and the name of the Web Application resource followed
by a unique session identifyer. This variable is typically used for the ACTION in a FORM or for
hyperlinks in normal HTML documents.
|
<@**CAPPACTION@>
As for <@**APPACTION@>, but the <@**CAPPACTION@> variable is used for HTML
frame documents.
|
<@**MSGBOXTITLE@>
The title of the current message box.
|
<@**MSGBOXTEXT@>
The text of the current message box.
|
|