/system/redirect.php

Description

PHP helper script to "redirect" request.

This PHP script allows one to redirect the user's browser to another location by "tweaking" any of the following:

  • proto: The protocol field ("http", "https", "ftp", etc).
  • host: The host address.
  • port: The port to use for the connection (if you specify the reserved word: "OMIT", then we will omit the port from the redirect URL).
  • uri: The URI relative to the server ("/nstwui/index.cgi"). NOTE: If you pass this parameter, it MUST start with a leading '/'. If omitted, we will default to: "/".
Any parameters NOT specified will default to the current values in the request.

This is useful for creating "static" links which will go to the proper location when placed on another web server. For example, consider the following:

/nstwui/php/system/redirect.php?proto=https&port=631
The above will cause one to be redirected to:

https://SERVER_ADDR:631/
The important thing to note is that since the "host" parameter was omitted in the original request, the SERVER_ADDR shown above will be left at IP address where the original request was made.

  • author: Paul Blankenbaker
Functions
getRequestValue (line 52)

Get value from request or return default.

  • return: The value to use.
string getRequestValue ( $name, string $defval, string $key)
  • string $key: The key to look up the value from a POST or GET.
  • string $defval: The value to return if nothing found.
  • $name

Documentation generated on Sun, 11 Feb 2018 07:41:02 -0500 by phpDocumentor 1.4.4