<slide title="register_globals">
<blurb>
PHP automatically creates global variables containing data from a variety of 
external sources.  This feature can be turned off by turning off the 
register_globals setting.  With register_globals
you can access this data via a number of special associative arrays listed below.
</blurb>

<example title="$_GET['foo']='bar'"><![CDATA[http://www.php.net/index.php?foo=bar]]></example>

<example title="$_POST['foo']='bar'"><![CDATA[<form action="script.php" method="POST">
<input type="text" name="foo" value="bar">
</form>]]></example>

<example title="$_COOKIE['foo']='bar'"><![CDATA[<?php
    SetCookie('foo','bar');
?>]]></example>

<example title="$_REQUEST['foo']='bar'"><![CDATA[<?php
    SetCookie('foo','bar');
?>]]></example>

<blurb title="$_SERVER">
Special variables set by your web server.  You can get a list of what
is set by running this code on your server:
</blurb>
<example><![CDATA[<?php
foreach($_SERVER as $key=>$val) {
	echo '$_SERVER['.$key."] = $val<br>\n";
}
?>]]></example>
<example hide="1" result="1" rfontsize="1.5em"><![CDATA[<?php
$old = error_reporting(0);
foreach($_SERVER as $key=>$val) {
	$val = strip_tags($val);
	if(strlen($val)>40) $val=substr($val,0,40).'...';
	echo '$_SERVER['.$key."] = $val<br>\n";
}
error_reporting($old);
?>]]></example>

<blurb title="$_ENV">
Environment variables that were present at server startup time.  Note that environment
variables created by PHP using putenv() will not be shown here,
nor do they persist beyond the request.
</blurb>
<example hide="1" result="1" rfontsize="1.5em"><![CDATA[<?php
$str = '';
foreach($_ENV as $key=>$val) {
	$val = strip_tags($val);
	if(strlen($val)>40) $val=substr($val,0,40).'...';
	echo '$_ENV['.$key."] = $val<br>\n";
}
?>]]></example>

<blurb title="$_FILES">
Used for the RFC1867 file upload feature.
</blurb>
<example><![CDATA[$_FILES['userfile']['name']
$_FILES['userfile']['type']
$_FILES['userfile']['size']
$_FILES['userfile']['tmp_name']]]></example>

<blurb title="$HTTP_RAW_POST_DATA">
When the mime type associated with the POST data is unrecognized or not set, the
raw post data is available in this variable.
</blurb>

</slide>
