Correcting several mistakes, and misspellings

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@70252 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Gabor Hojtsy 2002-02-14 19:35:20 +00:00
parent 74572a3ce1
commit a06b86e1da

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.33 $ -->
<!-- $Revision: 1.34 $ -->
<chapter id="features.file-upload">
<title>Handling file uploads</title>
@ -54,11 +54,10 @@ Send this file: <input name="userfile" type="file">
version and configuration. Following variables will be defined
within the destination script upon a successful upload. When <link
linkend="ini.track-vars">track_vars</link> is enabled,
$HTTP_POST_FILES/ $_FILES array is initialized. <link
linkend="ini.track-vars">track_vars</link> is always on from PHP
4.0.3. Finally, related variables may be initialized as globals
when <link linkend="ini.register-globals">register_globals</link>
is turned on . However, use of globals is not recommended anymore.
$HTTP_POST_FILES/$_FILES array is initialized. Finally, related
variables may be initialized as globals when
<link linkend="ini.register-globals">register_globals</link>
is turned on. However, use of globals is not recommended anymore.
</para>
<note>
<para>
@ -119,8 +118,8 @@ Send this file: <input name="userfile" type="file">
</para>
<note>
<para>
PHP 4.1.0 or later supports short track var variable
<varname>$_FILES</varname>. PHP3 does not support
PHP 4.1.0 or later supports a short track variable
<varname>$_FILES</varname>. PHP 3 does not support
<varname>$HTTP_POST_FILES</varname>.
</para>
</note>
@ -159,9 +158,9 @@ Send this file: <input name="userfile" type="file">
</listitem>
</itemizedlist>
Note that the "<varname>$userfile</varname>" part of the above
variables is whatever the name of the INPUT field of TYPE=file is
in the upload form. In the above upload form example, we chose to
call it "userfile"
variables is whatever the name of the &lt;input&gt; field of
type="file" is in the upload form. In the above upload form
example, we chose to call it "userfile".
</para>
<note>
<para>
@ -195,7 +194,7 @@ Send this file: <input name="userfile" type="file">
if (is_uploaded_file($HTTP_POST_FILES['userfile']['tmp_name'])) {
copy($HTTP_POST_FILES['userfile']['tmp_name'], "/place/to/put/uploaded/file");
} else {
echo "Possible file upload attack: filename '".$HTTP_POST_FILES['userfile']['name'].".";
echo "Possible file upload attack. Filename: " . $HTTP_POST_FILES['userfile']['name'];
}
/* ...or... */
move_uploaded_file($HTTP_POST_FILES['userfile']['tmp_name'], "/place/to/put/uploaded/file");
@ -296,9 +295,9 @@ move_uploaded_file($HTTP_POST_FILES['userfile']['tmp_name'], "/place/to/put/uplo
<varname>$HTTP_POST_FILES['userfile']</varname>,
<varname>$HTTP_POST_FILES['userfile']['name']</varname>, and
<varname>$HTTP_POST_FILES['userfile']['size']</varname> will be
initialized. (as well as in $_FILES for PHP 4.1.0 or
initialized. (As well as in $_FILES for PHP 4.1.0 or
later. $HTTP_POST_VARS in PHP 3. When
<literal>register_globals</literal> is on, Globals for uploaded
<literal>register_globals</literal> is on, globals for uploaded
files are also initialized). Each of these will be a numerically
indexed array of the appropriate values for the submitted files.
</simpara>