HTML or XML variables
HTML or XML Variables

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.

General Variables

<@**DATE@>
Current date in long format.
2017-10-22
<@**TIME@>
Current time in long format.
00:53:15
<@**UTC@>
Current date and time in Universal Time Convention (UTC) format.
Sat, 21 Oct 2017 22:53:15 GMT
<@**MODDATE@>
The current resource last changed date in long format.
2011-11-07
<@**MODUTC@>
The current resource last changed date and time in Universal Time Convention (UTC) format.
Mon, 07 Nov 2011 10:23:54 GMT
<@**PROGDIR@>
Phantom directory.
.
<@**PROGVER@>
Phantom program version string.
NetPhantom Version 6.70 (Build 6722)
<@**PROGBUILD@>
The program version in the format 1.23 (Build 456).
6.70 (Build 6722)
<@**PROGVER2@>
The program version according to HTTP standard product comment, e.g. NetPhantom/1.23 (Build 456) Java/1.2.3.
NetPhantom/6.70 (Build 6722) Java/1.8.0_60
<@**OSVER@>
Operating System version.
2.6.18-028stab118.1
<@**OSNAME@>
Operating System name.
Linux
<@**JAVAVER@>
Java version.
1.8.0_60
<@**JAVAVENDOR@>
Java vendor.
Oracle Corporation
<@**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).
6,7,0,6722

HTTP Related Variables

The variables below are related to the HTTP session.

<@**AGENT@>
The user agent of the requesting client, i.e. the browser name and version.
CCBot/2.0 (http://commoncrawl.org/faq/)
<@**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.
38836
<@**CLIENTADDR@>
The client host address.
54.81.79.128
<@**CLIENTNAME@>
host name of the client or the IP address as nnn.mmm.ooo.ppp if none is found.
54.81.79.128
<@**SERVERPORT@>
The port of the server that the client is accessing.
80
<@**CTRLSERVERPORT@>
The port of the controller server that the client is accessing. This is used for Load Balancing.
80
<@**SERVERADDR@>
The host address of the server.
188.121.60.191
<@**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.
8124
<@**FULLSRVNAME@>
The full server name including the protocol, i.e. http[s]://fullsrvname.
http://www.netphantom.com
<@**FULLCTRLSRVNAME@>
The full server name of the controller server including the protocol. This is used for Load Balancing.
http://www.netphantom.com
<@**HTTPMETHOD@>
The method used to handle the request (GET or PUT).
GET
<@**PROTOCOL@>
The protocol used (evaluates to http or https).
http
<@**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: 0
2: 0
3: 0
4: <none>
<@**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".
 
<@**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@">.
<@#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.
 

Web Application Related Variables

The variables below are used when for NetPhantom Web Applications.

<@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.