Consider the following form, used to solicit subscriber information:
84 CHAPTER 3 ?– PHP B ASICS
The following POST variables will be made available via the target subscribe.php script:
$_POST['email'] = "jason@example.com";
$_POST['pswd'] = "rainyday";
$_POST['subscribe'] = "subscribe!";
Like $_GET, the $_POST superglobal is by default the only way to access POST variables.
You cannot reference POST variables like this: $email, $pswd, and $subscribe.
Retrieving Information Stored Within Cookies
The $_COOKIE superglobal stores information passed into the script through HTTP
cookies. Such cookies are typically set by a previously executed PHP script through
the PHP function setcookie(). For example, suppose that you use setcookie() to store
a cookie named example.com with the value ab2213. You could later retrieve that value
by calling $_COOKIE["example.com"]. Chapter 18 introduces PHP??™s cookie-handling
capabilities.
Retrieving Information About Files Uploaded Using POST
The $_FILES superglobal contains information regarding data uploaded to the server
via the POST method.
Pages:
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169