From PhiWiki
Jump to: navigation, search

In text data sources you can make usage of special Phi variables. The Phi variables are substituted by their value. Ensure you checked the field Parse data in the Text source dialog otherwise the variables will not be substituted.

See also: Text sources.


Searches in all categories ie. cookies, GET variables, POST variables, etc. This can be time consuming.


Returns the cookie set for name or an empty string if the cookie is not set.



Returns the appropriate component of an uploaded file for name. The component filename returns the original file name, tmpfile is the absolute path where the file is temporarely stored and size is the file size in bytes.


See also: File class, File upload.


Returns the value for name for a GET request.



Returns the HTTP header string for header.


Returns the browser agent string:


See also: HTTP header.


Returns the value for name for a POST request.


Note: in Phi all form input elements are sent as POST data.

See also: Form action,


Searches in the categories GET, POST and COOKIE.


The contents of myfield will be returned if it was set by a GET, POST or COOKIE request.

Note: A cookie has precedence before a POST and a POST before a GET if concurrent values are set.



Contains the HTTP accept string the browser sent. This is the same as $PHIHEADER[accept].


The server administrator's email address.


Client user agent string. This is the same like $PHIHEADER[User-Agent].


Content type of the request.


Length in bytes of the requested POST data.


Contains the document root as an absolute path.


Requested filename including the absolut path on the local maschine.


The requested domain (part of the HTTP header Host: domain).


Contains the keep alive time a connection remains valid without any data exchange. This can be set in the server configuration.


Returns the current language used for this page requested by the browser and available by the server or the default language 'C' if no language does match. This may be overwritten by philang=<lang id> in the URL query string.


See also: phi.lang, document.lang.


Contains the local IP address of the server.

See also: $PHISERVER[remoteaddress].


Request method (usually http or https).


Date and time of the last modification of $PHISERVER[filename] in the format yyyymmddhhmmsszzz.


Returns the name of the current month (translated by the system locale) for $PHISERVER[lang].

$PHISERVER[month] or

To optain a translated month name in the year (in this example february) use:



Returns a complete monthlist separeted by '\n' with the respective month number in squared brackets.

$PHISERVER[monthlist] (january[1]\nfebruary[2]\n...december[12]\n)

Note: the month names are automatically translated to the appropriate language if the requested locale is available on the server maschine.


Date and time in GMT (universal time) in the format yyyymmddhhmmsszzz.

See also: $PHISERVER[started].


Contains the password part of the HTTP header (ie. if you protect pages with .htaccess).

See also: $PHISERVER[user].


The actual port the server is listening on (usually 80 or 8080).


Contains the POST data as a complete URL query string.


Contains the remote IP address of the client for this request.

See also: $PHISERVER[localaddress].


Path of the current requested URL.


Server definition string. In conjunction with Phis server this is usually default.


Full qualified domain name of the server.


If you use the Phis server this contains the version and system string. Using the Apache module this contains the Apache server version.


Date and time when the request started in the format yyyymmddhhmmsszzz in local server time.

See also: $PHISERVER[nowutc].


Contains the server's temporary directory where database files and images are stored.

Note: this is not necessarely the system's temp directory! If you want to obtain the system's temp directory you may use file.tempdir in JavaScript.


Returns the current date in the ISO format YYYY-MM-DD or days after/before if you specify an index.

$PHISERVER[today][3] (three days in the future)
$PHISERVER[today][-5] (five days in the back)


URL string of the request.


Contains the user part of the HTTP header (ie. if you restrict pages with .htaccess.

See also: $PHISERVER[password].


v1.4.1 Returns the user agent as a string. Currently supported are:

  • MSIE
  • Safari
  • Firefox
  • Chrome
  • Konqueror
  • SeaMonkey
  • Amphibia


v1.4.1 Returns the user engine as a string. Supported are:

  • Trident
  • WebKit
  • Gecko
  • Presto


v1.4.1 Returns the user operating system as a string. Currently supported are:

  • Windows
  • MacOSX
  • iOS
  • Linux
  • Android
  • WindowsMobile
  • Symbian
  • Solaris
  • HPUX
  • AIX


v1.4.1 Returns the current Phi version in the form 'major.minor.patch'.


Returns the current year in the ISO format or a year in the future or in the back by the offset.

$PHISERVER[year] (2010, if this is the current year)
$PHISERVER[year][3] (2013, if 2010 is the current year)
$PHISERVER[year][-2] (2008, if 2010 is the current year)


Returns a year list separated by a '\n' if you specify an index or the currenty year without any index.

$PHISERVER[yearlist][3] (2010\n2011\n2012, if 2010 is the current year)

The maximum index is 1000.


Returns the SQL value at position x (starting from 0).


Asume the following SQL statement:

SELECT firstname, lastname FROM persons WHERE id=$PHIGET[uid]

Then lastname will be accessible through: