Learning More About the Operating System Environment
The $_ENV superglobal offers information regarding the PHP parser??™s underlying server
environment. Some of the variables found in this array include the following:
$_ENV['HOSTNAME']: The server hostname
$_ENV['SHELL']: The system shell
?– Caution PHP supports two other superglobals, namely $GLOBALS and $_REQUEST. The $_REQUEST
superglobal is a catch-all of sorts, recording variables passed to a script via the GET, POST, and Cookie
methods. The order of these variables doesn??™t depend on the order in which they appear in the sending
script, but rather it depends on the order specified by the variables_order configuration directive.
The $GLOBALS superglobal array can be thought of as the superglobal superset and contains a comprehensive
listing of all variables found in the global scope. Although it may be tempting, you shouldn??™t use
these superglobals as a convenient way to handle variables because it is insecure. See Chapter 21 for
an explanation.
86 CHAPTER 3 ?– PHP B ASICS
Retrieving Information Stored in Sessions
The $_SESSION superglobal contains information regarding all session variables. Registering
session information allows you the convenience of referring to it throughout
your entire Web site, without the hassle of explicitly passing the data via GET or POST.
Chapter 18 is devoted to PHP??™s formidable session-handling feature.
Pages:
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171