User Tools

Site Tools


uphp:uphp_special_variables

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
uphp:uphp_special_variables [2017/02/12 11:01]
jeff created
uphp:uphp_special_variables [2021/09/13 05:57] (current)
Line 1: Line 1:
-====== uPHP Special Variables ======+======uPHP Special Variables======
  
-uPHP has several special arrays that are populated automatically before the script is run.+uPHP has several special arrays that are populated automatically before the script is run:
  
-''**$_SERVER**''provides information about the server and script+''**[[$_SERVER]]**''Information about the server and script
  
-''**$_GET**''provides an array of get parameters passed to the script - this is only applicable for scripts run from the web interface, not from telnet or cron.  The maximum number of get parameters is 7, and the maximum length of each parameter is 32 bytes.+''**$_GET**''Parameters passed to the script - this is only applicable for scripts run from the web interface, not from telnet or cron. The maximum number of GET parameters is 7, and the maximum length of each parameter is 32 bytes.
  
-''**$_POST**''provides an array of all POST variables which were submitted to the HTTP script - this can be used to save multiple parameters from a web form+''**$_POST**''Variables submitted to the HTTP script. This can be used to save multiple parameters from a web form.
  
-''**$_GLOBALS**''an array of system-wide global variables that can be used as a shared memory area between scripts.  This is only cleared upon a reboot.+''**$_GLOBALS**''System-wide global variables that can be used as a shared memory area between scripts. This is only cleared upon a reboot.
  
-//Note:  This is different from the PHP $GLOBALS -// this is truly global and accessible across scripts.  $GLOBALS does not exist in uPHP - instead use the global keyword to reference a global script variable.+Note:  //This is different from the PHP $GLOBALS -// this is truly global and accessible across scripts.  $GLOBALS does not exist in uPHP - instead use $_GLOBALS['key_name'to reference a global script variable.
  
-''**$_SESSION**'' - session variables can be defines here and will be persistent for any web session using a SESSID cookie+Tip:  If you wish to view the global variables in the system you can execute /scripts/tests/globals.cgi. This simple script shows the entire contents of the $_GLOBALS array, which is useful for learning about the [[hardware:wattmons|Wattmon]] system for customizing, programming and debugging purposes.
  
-''**$_COOKIES**'' - cookie data can be defined and access here, to be passed back to the browser+''**$_SESSION**''Variables defined here are persistent for any web session using a SESSID cookie 
 + 
 +''**$_COOKIES**'' - Cookie data defined to be accessed or passed back to the browser
  
uphp/uphp_special_variables.1486897316.txt.gz · Last modified: 2021/09/13 05:56 (external edit)