cvs: phpdoc /kr/features cookies.xml error-handling.xml file-upload.xml http-auth.xml images.xml

From: Date: Tue, 09 Jan 2001 11:27:54 +0000
Subject: cvs: phpdoc /kr/features cookies.xml error-handling.xml file-upload.xml http-auth.xml images.xml
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969333507@lists.php.net to get a copy of this message
regina Tue Jan 9 03:27:54 2001 EDT Modified files: /phpdoc/kr/features cookies.xml error-handling.xml file-upload.xml http-auth.xml images.xml Log:

Index: phpdoc/kr/features/cookies.xml diff -u phpdoc/kr/features/cookies.xml:1.1 phpdoc/kr/features/cookies.xml:1.2 --- phpdoc/kr/features/cookies.xml:1.1 Tue Jan 9 02:58:55 2001 +++ phpdoc/kr/features/cookies.xml Tue Jan 9 03:27:54 2001 @@ -1,17 +1,17 @@ <chapter id="features.cookies"> <title>Cookies</title> <para> - PHPÎäî HTTP Cookie΀º Ìà¨ÎÖÌïò;å(transparently) ÏßÄÏõêÌïúÎã§. - Cookie Ωîϼ¥Îãà϶òÏùÄ Ìä½ÎûòÌǼÏù¥ÎÇò ÏǨÏö©Ïûê ÏãùÎ„Ñ Îì±ÏùÑ ÏúÑÌï¥ Ïõê;© browserÏóê - ÏÝÄÏû€Îêú ÎçƒÏù¥Ìу΀º ÎèåÎݧ ΃õÎäî ̈́ºÏÝïÏùÑ ÎßêÌïúÎã§. - Ïó¨Îü¨ÎÑÏùÄ cookie΀º ÏѧÏÝïÌïòͽƒ ÏúÑÌï¥ <function>setcookie</function> Ìï®Ïàò΀º ÏǨÏö©ÌïÝ Ïàò ÏûàÎã§. - CookieÎäî HTTP Ìó§ÎçîÏùò Ìïú ΏÄΏÑÏù¥ÎØÄΰú, <function>setcookie</function> Ìï®ÏàòÎäî νåÎùºÏöƒÏÝÄΰú - ΄¥ÎÇ¥Îäî Ïñ¥Îñ§ ÎçƒÏù¥Ìу΄¥Îã§ÎèÑ ÏïûÏóê ÏǨÏö©Ìï¥Ïïº ÌïúÎã§. - Ïù¥ ÏÝúÏï‡ÏùÄ <function>header</function> Ìï®ÏàòÏôÄ ÍƒôÏùÄ ÏÝúÏï‡ÏúºÎ°ú ΄¥Î©¥ ÎêúÎã§.</para> + PHP는 HTTP Cookie를 투명하게(transparently) 지원한다. + Cookie 메카니즘은 트래킹이나 사용자 식별 등을 위해 원격 browser에 + 저장된 데이터를 돌려 받는 과정을 말한다. + 여러분은 cookie를 설정하기 위해 <function>setcookie</function> 함수를 사용할 수 있다. + Cookie는 HTTP 헤더의 한 부분이므로, <function>setcookie</function> 함수는 브라우저로 + 보내는 어떤 데이터보다도 앞에 사용해야 한다. + 이 제약은 <function>header</function> 함수와 같은 제약으로 ë³´ë©´ 된다.</para> <para> - ÌÅ¥ÎùºÏù¥Ïñ½Ìä½ÍƒÄ ΄¥ÎÇ¥Ï§Ä Î®ÎìÝ cookieÎäî ÏûêÎèôÏÝÅÏúºÎ°ú GETÏù¥ÎÇò POST ΃©Ïãù ÎçƒÏù¥ÌуÏôÄ ÍƒôÏùÄ PHP ΄ÄÏàòΰú ΄ÄÌôòÎêúÎã§. - ÎßåÏï‡ Ïó¨Îü¨ÎÑÏù¥ ÎèôÏùºÌïú cookieÏóê Ïó¨Îü¨ ̓íÏùÑ ÏÝÄÏû€ÌïòÍ„Ý ÏãÎã§Î©¥ CookieÏù¥Î¶ÑÏóê <emphasis>[]</emphasis>΀º ÎçîÌïòΩ¥ ÎêúÎã§. - ÏûêÏѽÌïú ;ÉÏùÄ <function>setcookie</function> Ìï®Ïàò Ïѧ΁ÖÏùÑ Ïƒ½Ï°ƒÌïòÏûê. + 클라이언트가 보내준 모든 cookie는 자동적으로 GET이나 POST 방식 데이터와 같은 PHP 변수로 변환된다. + 만약 여러분이 동일한 cookie에 여러 값을 저장하고 싶다면 Cookie이름에 <emphasis>[]</emphasis>를 더하면 된다. + 자세한 것은 <function>setcookie</function> 함수 설명을 참조하자. </para> </chapter> <!-- Keep this comment at the end of the file Index: phpdoc/kr/features/error-handling.xml diff -u phpdoc/kr/features/error-handling.xml:1.1 phpdoc/kr/features/error-handling.xml:1.2 --- phpdoc/kr/features/error-handling.xml:1.1 Tue Jan 9 02:58:55 2001 +++ phpdoc/kr/features/error-handling.xml Tue Jan 9 03:27:54 2001 @@ -1,7 +1,7 @@ <chapter id="features.error-handling"> <title>Error Handling</title> <para> - PHPÏóêÎäî Îã§Ïùå̈́º ̓ôÏùÄ Ïó¨Îü¨ ÏóêÎü¨ÏôÄ Í¾‡Í„Ý ÌòïÌÉúÍƒÄ ÏûàÎã§.: + PHP에는 다음과 같은 여러 에러와 경고 형태가 있다.: <table> <title>PHP error types</title> <tgroup cols="4"> @@ -17,26 +17,26 @@ <row> <entry>1</entry> <entry>E_ERROR</entry> - <entry>Normal Function Errors (ÏùºÎƒòÏÝÅÏù½ ÏóêÎü¨)</entry> + <entry>Normal Function Errors (일반적인 에러)</entry> <entry/> </row> <row> <entry>2</entry> <entry>E_WARNING</entry> - <entry>Normal Warnings (ÏùºÎƒòÏÝÅÏù½ ;‡Í„Ý)</entry> + <entry>Normal Warnings (일반적인 경고)</entry> <entry/> </row> <row> <entry>4</entry> <entry>E_PARSE</entry> - <entry>Parser Errors (Ψ½Î¾ï ÏóêÎü¨)</entry> + <entry>Parser Errors (문법 에러)</entry> <entry/> </row> <row> <entry>8</entry> <entry>E_NOTICE </entry> <entry> - Notices (Ψ¥ÏãúÌïÝ Ïàò ÏûàÎäî ÏïåζºÏù¥ÏßÄÎßå ξÑͅ½Ïùò ̓ÄÎä€ÏѱÏùÑ ÍƒÄÏßÄÍ„Ý ÏûàÎäî ;‡Ïöƒ) + Notices (무시할 수 있는 알림이지만 버그의 가능성을 가지고 있는 경우) </entry> <entry/> </row> @@ -44,50 +44,50 @@ <entry>16</entry> <entry>E_CORE_ERROR</entry> <entry>fatal errors that occur during PHP's initial startup - (PHPÍƒÄ Ï¾òÏùå ÏãúÏûëÎêÝ Îïå ΃úÏÉùÌïú ϼò΁ÖÏÝÅ ÏóêÎü¨)</entry> + (PHP가 처음 시작될 때 발생한 치명적 에러)</entry> <entry>PHP 4 only</entry> </row> <row> <entry>32</entry> <entry>E_CORE_WARNING</entry> <entry>warnings (non fatal errors) that occur during PHP's initial startup - (PHPÍƒÄ Ï¾òÏùå ÏãúÏûëÎêÝ Îïå ΃úÏÉùÌïú ϼò΁ÖÏÝÅÏù¥ÏßÄ ÏïäÏùÄ Í¾‡Í„Ý)</entry> + (PHP가 처음 시작될 때 발생한 치명적이지 않은 경고)</entry> <entry>PHP 4 only</entry> </row> <row> <entry>64</entry> <entry>E_COMPILE_ERROR</entry> - <entry>fatal compile-time errors (Ϫ¥ÌååÏùºÏãú ÏÉùͽ¥ ϼò΁ÖÏÝÅ ÏóêÎü¨)</entry> + <entry>fatal compile-time errors (컴파일시 생긴 치명적 에러)</entry> <entry>PHP 4 only</entry> </row> <row> <entry>128</entry> <entry>E_COMPILE_WARNING</entry> - <entry>compile-time warnings (non fatal errors) (Ϫ¥ÌååÏùºÏãú ΃úÏÉùÌïú ϼò΁ÖÏÝÅÏù¥ÏßÄ ÏïäÏùÄ Í¾‡Í„Ý)</entry> + <entry>compile-time warnings (non fatal errors) (컴파일시 발생한 치명적이지 않은 경고)</entry> <entry>PHP 4 only</entry> </row> <row> <entry>256</entry> <entry>E_USER_ERROR</entry> - <entry>user-generated error message (ÏǨÏö©ÏûêÍƒÄ ÎßåÎìÝ ÏóêÎü¨ ΩîÏѽÏßÄ)</entry> + <entry>user-generated error message (사용자가 만든 에러 메세지)</entry> <entry>PHP 4 only</entry> </row> <row> <entry>512</entry> <entry>E_USER_WARNING</entry> - <entry>user-generated warning message (ÏǨÏö©ÏûêÍƒÄ ÎßåÎìÝ Í¾‡Í„Ý ΩîÏѽÏßÄ)</entry> + <entry>user-generated warning message (사용자가 만든 경고 메세지)</entry> <entry>PHP 4 only</entry> </row> <row> <entry>1024</entry> <entry>E_USER_NOTICE </entry> - <entry>user-generated notice message (ÏǨÏö©ÏûêÍƒÄ ÎßåÎìÝ Ïïåζº ΩîÏѽÏßÄ)</entry> + <entry>user-generated notice message (사용자가 만든 알림 메세지)</entry> <entry>PHP 4 only</entry> </row> <row> <entry/> <entry>E_ALL</entry> - <entry>all of the above, as supported (ÏßÄÏõê̓ÄÎä€Ìïú ÏúÑÏùò Í¾É Î®Îëê)</entry> + <entry>all of the above, as supported (지원가능한 위의 것 모두)</entry> <entry/> </row> </tbody> @@ -130,9 +130,9 @@ </para> </warning> <para> - ΁®ÎìÝ <link linkend="language.expressions">PHP ÌëúÌòÑÏãù(expression)</link>ÏùÄ "@"΀º ÏïûÏóê ΏôÏù¥Í„Ý Ìò½ÏúÎêòΩ¥ error reportingÏùÑ ÌïòÏßÄ ÏïäÎäîÎã§. - ÎßåÏï‡ <link linkend="ini.track-errors">track_errors</link> ÏòµÏÖòÏù¥ Enabledΰú ÎêòÏñ¥ ÏûàÍ„Ý Ìï¥Î㼠Ψ½Ïû€ÏóêÏÑú ÏóêÎü¨ÍƒÄ ΃úÏÉùÌñàÎã§Î©¥, - $php_errormsgÎùºÎäî ÏÝÑÏó‚΄ÄÏàòÏóê ÏóêÎü¨ ΩîÏãúÏßÄÍƒÄ Îã¥Í¾® Ïûà;å ÎêúÎã§. + 모든 <link linkend="language.expressions">PHP 표현식(expression)</link>은 "@"를 앞에 붙이고 호출되면 error reporting을 하지 않는다. + 만약 <link linkend="ini.track-errors">track_errors</link> 옵션이 Enabled로 되어 있고 해당 문장에서 에러가 발생했다면, + $php_errormsg라는 전역변수에 에러 메시지가 담겨 있게 된다. </para> <warning> <para> Index: phpdoc/kr/features/file-upload.xml diff -u phpdoc/kr/features/file-upload.xml:1.1 phpdoc/kr/features/file-upload.xml:1.2 --- phpdoc/kr/features/file-upload.xml:1.1 Tue Jan 9 02:58:55 2001 +++ phpdoc/kr/features/file-upload.xml Tue Jan 9 03:27:54 2001 @@ -1,10 +1,8 @@ - <chapter id="features.file-upload"> - <title>Handling file uploads</title> - - <sect1 id="features.file-upload.post-method"> - <title>POST method uploads</title> - - <simpara> +<chapter id="features.file-upload"> + <title>Handling file uploads</title> + <sect1 id="features.file-upload.post-method"> + <title>POST method uploads</title> + <simpara> PHP is capable of receiving file uploads from any RFC-1867 compliant browser (which includes Netscape Navigator 3 or later, Microsoft Internet Explorer 3 with a patch from Microsoft, or @@ -13,75 +11,70 @@ functions, you have full control over who is allowed to upload and what is to be done with the file once it has been uploaded. </simpara> - <para> + <para> Note that PHP also supports PUT-method file uploads as used by - Netscape Composer and W3C's Amaya clients. See the <link - linkend="features.file-upload.put-method">PUT Method + Netscape Composer and W3C's Amaya clients. See the <link linkend="features.file-upload.put-method">PUT Method Support</link> for more details. </para> - <para> + <para> A file upload screen can be built by creating a special form which looks something like this: <example> - <title>File Upload Form</title> - <programlisting> + <title>File Upload Form</title> + <programlisting> &lt;FORM ENCTYPE=&quot;multipart/form-data&quot; ACTION=&quot;_URL_&quot; METHOD=POST&gt; &lt;INPUT TYPE=&quot;hidden&quot; name=&quot;MAX_FILE_SIZE&quot; value=&quot;1000&quot;&gt; Send this file: &lt;INPUT NAME=&quot;userfile&quot; TYPE=&quot;file&quot;&gt; &lt;INPUT TYPE=&quot;submit&quot; VALUE=&quot;Send File&quot;&gt; &lt;/FORM&gt; </programlisting> - </example> + </example> The _URL_ should point to a PHP file. The MAX_FILE_SIZE hidden field must precede the file input field and its value is the maximum filesize accepted. The value is in bytes. </para> - - <para> + <para> In PHP 3, the following variables will be defined within the - destination script upon a successful upload, assuming that <link - linkend="ini.register-globals">register_globals</link> is turned - on in <filename>php3.ini</filename>. If <link - linkend="ini.track-vars">track_vars</link> is turned on, they will + destination script upon a successful upload, assuming that <link linkend="ini.register-globals">register_globals</link> is turned + on in <filename>php3.ini</filename>. If <link linkend="ini.track-vars">track_vars</link> is turned on, they will also be available in PHP 3 within the global array <varname>$HTTP_POST_VARS</varname>. Note that the following variable names assume the use of the file upload name 'userfile', as used in the example above: <itemizedlist> - <listitem> - <simpara> - <varname>$userfile</varname> - The temporary filename in which + <listitem> + <simpara> + <varname>$userfile</varname> - The temporary filename in which the uploaded file was stored on the server machine. </simpara> - </listitem> - <listitem> - <simpara> - <varname>$userfile_name</varname> - The original name or path + </listitem> + <listitem> + <simpara> + <varname>$userfile_name</varname> - The original name or path of the file on the sender's system. </simpara> - </listitem> - <listitem> - <simpara> - <varname>$userfile_size</varname> - The size of the uploaded + </listitem> + <listitem> + <simpara> + <varname>$userfile_size</varname> - The size of the uploaded file in bytes. </simpara> - </listitem> - <listitem> - <simpara> - <varname>$userfile_type</varname> - The mime type of the file + </listitem> + <listitem> + <simpara> + <varname>$userfile_type</varname> - The mime type of the file if the browser provided this information. An example would be &quot;image/gif&quot;. </simpara> - </listitem> - </itemizedlist> + </listitem> + </itemizedlist> Note that the &quot;$userfile&quot; 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 &quot;userfile&quot; </para> - - <para> + <para> In PHP 4, the behaviour is slightly different, in that the new global array <varname>$HTTP_POST_FILES</varname> is provided to contain the uploaded file information. This is still only @@ -89,54 +82,59 @@ turned on, but <link linkend="ini.track-vars">track_vars</link> is always turned on in versions of PHP after PHP 4.0.2. </para> - - <para> + <para> The contents of <varname>$HTTP_POST_FILES</varname> are as follows. Note that this assumes the use of the file upload name 'userfile', as used in the example above: <variablelist> - <varlistentry> - <term><varname>$HTTP_POST_FILES['userfile']['name']</varname></term> - <listitem> - <para> + <varlistentry> + <term> + <varname>$HTTP_POST_FILES['userfile']['name']</varname> + </term> + <listitem> + <para> The original name of the file on the client machine. </para> - </listitem> - </varlistentry> - <varlistentry> - <term><varname>$HTTP_POST_FILES['userfile']['type']</varname></term> - <listitem> - <para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <varname>$HTTP_POST_FILES['userfile']['type']</varname> + </term> + <listitem> + <para> The mime type of the file, if the browser provided this information. An example would be <literal>&quot;image/gif&quot;</literal>. </para> - </listitem> - </varlistentry> - <varlistentry> - <term><varname>$HTTP_POST_FILES['userfile']['size']</varname></term> - <listitem> - <para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <varname>$HTTP_POST_FILES['userfile']['size']</varname> + </term> + <listitem> + <para> The size, in bytes, of the uploaded file. </para> - </listitem> - </varlistentry> - <varlistentry> - <term><varname>$HTTP_POST_FILES['userfile']['tmp_name']</varname></term> - <listitem> - <para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <varname>$HTTP_POST_FILES['userfile']['tmp_name']</varname> + </term> + <listitem> + <para> The temporary filename of the file in which the uploaded file was stored on the server. </para> - </listitem> - </varlistentry> - </variablelist> - </para> - - <para> + </listitem> + </varlistentry> + </variablelist> + </para> + <para> Files will by default be stored in the server's default temporary - directory, unless another location has been given with the <link - linkend="ini.upload-tmp-dir">upload_tmp_dir</link> directive in + directory, unless another location has been given with the <link linkend="ini.upload-tmp-dir">upload_tmp_dir</link> directive in <filename>php.ini</filename>. The server's default directory can be changed by setting the environment variable <envar>TMPDIR</envar> in the environment in which PHP runs. @@ -145,15 +143,15 @@ to make sure that other operations are working on uploaded files, as well. <example> - <title>Validating file uploads</title> - <para> + <title>Validating file uploads</title> + <para> The following examples are for versions of PHP 3 greater than 3.0.16, and versions of PHP 4 greater than 4.0.2. See the function entries for <function>is_uploaded_file</function> and <function>move_uploaded_file</function>. </para> - <programlisting role="php"> -&lt?php + <programlisting role="php"> +&lt;?php if (is_uploaded_file($userfile)) { copy($userfile, "/place/to/put/uploaded/file"); } else { @@ -163,19 +161,19 @@ move_uploaded_file($userfile, "/place/to/put/uploaded/file"); ?> </programlisting> - <para> + <para> For earlier versions of PHP, you'll need to do something like the following. <note> - <para> + <para> This will <emphasis>not</emphasis> work in versions of PHP 4 after 4.0.2. It depends on internal functionality of PHP which changed after that version. </para> - </note> - </para> - <programlisting role="php"> -&lt?php + </note> + </para> + <programlisting role="php"> +&lt;?php /* Userland test for uploaded file. */ function is_uploaded_file($filename) { if (!$tmp_file = get_cfg_var('upload_tmp_dir')) { @@ -193,9 +191,9 @@ } ?> </programlisting> - </example> - </para> - <simpara> + </example> + </para> + <simpara> The PHP script which receives the uploaded file should implement whatever logic is necessary for determining what should be done with the uploaded file. You can for example use the @@ -206,49 +204,47 @@ you should either delete the file from the temporary directory or move it elsewhere. </simpara> - <simpara> + <simpara> The file will be deleted from the temporary directory at the end of the request if it has not been moved away or renamed. </simpara> - </sect1> - - <sect1 id="features.file-upload.common-pitfalls"> - <title>Common Pitfalls</title> - <simpara> + </sect1> + <sect1 id="features.file-upload.common-pitfalls"> + <title>Common Pitfalls</title> + <simpara> The MAX_FILE_SIZE item cannot specify a file size greater than the file size that has been set in the upload_max_filesize in the PHP 3.ini file or the corresponding php3_upload_max_filesize Apache .conf directive. The default is 2 Megabytes. </simpara> - <simpara> + <simpara> Not validating which file you operate on may mean that users can access sensitive information in other directories. </simpara> - <simpara> + <simpara> Please note that the CERN httpd seems to strip off everything starting at the first whitespace in the content-type mime header it gets from the client. As long as this is the case, CERN httpd will not support the file upload feature. </simpara> - </sect1> - - <sect1 id="feature-fileupload.multiple"> - <title>Uploading multiple files</title> - <simpara> + </sect1> + <sect1 id="feature-fileupload.multiple"> + <title>Uploading multiple files</title> + <simpara> It is possible to upload multiple files simultaneously and have the information organized automatically in arrays for you. To do so, you need to use the same array submission syntax in the HTML form as you do with multiple selects and checkboxes: </simpara> - <note> - <para> + <note> + <para> Support for multiple file uploads was added in version 3.0.10. </para> - </note> - <para> - <example> - <title>Uploading multiple files</title> - <programlisting> + </note> + <para> + <example> + <title>Uploading multiple files</title> + <programlisting> &lt;form action=&quot;file-upload.php&quot; method=&quot;post&quot; enctype=&quot;multipart/form-data&quot;&gt; Send these files:&lt;br&gt; &lt;input name=&quot;userfile[]&quot; type=&quot;file&quot;&gt;&lt;br&gt; @@ -256,9 +252,9 @@ &lt;input type=&quot;submit&quot; value=&quot;Send files&quot;&gt; &lt;/form&gt; </programlisting> - </example> - </para> - <simpara> + </example> + </para> + <simpara> When the above form is submitted, the arrays <computeroutput>$userfile</computeroutput>, <computeroutput>$userfile_name</computeroutput>, and @@ -267,7 +263,7 @@ in PHP 3)). Each of these will be a numerically indexed array of the appropriate values for the submitted files. </simpara> - <simpara> + <simpara> For instance, assume that the filenames <filename>/home/test/review.html</filename> and <filename>/home/test/xwp.out</filename> are submitted. In this @@ -279,28 +275,26 @@ <computeroutput>$userfile_size[0]</computeroutput> would contain <filename>review.html</filename>'s filesize, and so forth. </simpara> - <simpara> - <computeroutput>$userfile['name'][0]</computeroutput>, + <simpara> + <computeroutput>$userfile['name'][0]</computeroutput>, <computeroutput>$userfile['tmp_name'][0]</computeroutput>, <computeroutput>$userfile['size'][0]</computeroutput>, and <computeroutput>$userfile['type'][0]</computeroutput> are also set. </simpara> - </sect1> - - <sect1 id="features.file-upload.put-method"> - <title>PUT method support</title> - - <para> + </sect1> + <sect1 id="features.file-upload.put-method"> + <title>PUT method support</title> + <para> PHP provides support for the HTTP PUT method used by clients such as Netscape Composer and W3C Amaya. PUT requests are much simpler than a file upload and they look something like this: <informalexample> - <programlisting> + <programlisting> PUT /path/filename.html HTTP/1.1 </programlisting> - </informalexample> - </para> - <para> + </informalexample> + </para> + <para> This would normally mean that the remote client would like to save the content that follows as: /path/filename.html in your web tree. It is obviously not a good idea for Apache or PHP to automatically @@ -312,33 +306,34 @@ common place is inside a &lt;Directory&gt; block or perhaps inside a &lt;Virtualhost&gt; block. A line like this would do the trick: <informalexample> - <programlisting> + <programlisting> Script PUT /put.php3 </programlisting> - </informalexample> - </para> - <simpara> + </informalexample> + </para> + <simpara> This tells Apache to send all PUT requests for URIs that match the context in which you put this line to the put.php3 script. This assumes, of course, that you have PHP enabled for the .php3 extension and PHP is active. </simpara> - <simpara> + <simpara> Inside your put.php3 file you would then do something like this: </simpara> - <para> - <informalexample><programlisting> + <para> + <informalexample> + <programlisting> &lt;?php copy($PHP_UPLOADED_FILE_NAME,$DOCUMENT_ROOT.$REQUEST_URI); ?&gt; - </programlisting></informalexample> - </para> - <simpara> + </programlisting> + </informalexample> + </para> + <simpara> This would copy the file to the location requested by the remote client. You would probably want to perform some checks and/or authenticate the user before performing this file copy. The only trick here is that when PHP sees a PUT-method request it stores the uploaded file in a temporary file just like those handled but - the <link - linkend="features.file-upload.post-method">POST-method</link>. + the <link linkend="features.file-upload.post-method">POST-method</link>. When the request ends, this temporary file is deleted. So, your PUT handling PHP script has to copy that file somewhere. The filename of this temporary file is in the $PHP_PUT_FILENAME @@ -348,10 +343,8 @@ You do not have to listen to this client. You could, for example, copy all uploaded files to a special uploads directory. </simpara> - </sect1> - - </chapter> - + </sect1> +</chapter> <!-- Keep this comment at the end of the file Local variables: mode: sgml Index: phpdoc/kr/features/http-auth.xml diff -u phpdoc/kr/features/http-auth.xml:1.1 phpdoc/kr/features/http-auth.xml:1.2 --- phpdoc/kr/features/http-auth.xml:1.1 Tue Jan 9 02:58:55 2001 +++ phpdoc/kr/features/http-auth.xml Tue Jan 9 03:27:54 2001 @@ -1,25 +1,25 @@ <chapter id="features.http-auth"> <title>HTTP authentication with PHP</title> <simpara> - (Ïó‚ÏûêÏ£º. HTTP authenticationÏù¥ÎûÄ Web ClientÏóê;å IDÏôÄ Password΀º ÏûÖÎ݀΃õÏïÑ, - ͅ½ IDÏôÄ Passwordΰú WebΨ½ÏÑúÏóê ÏÝëͅºÏùÑ Ìóà̓Ä, ΏàÌóàÌïòÎäî ͽƒÎä€ÏùÑ ÎßêÌïúÎã§. - ÏûêÏѽÌûà ÏïåÍ„Ý ÏãÎã§Î©¥ RFC1945Ïùò Authentication ΏÄΏÑÏùÑ Ïƒ½Í„ÝÌïòͽƒ ΃îÎûÄÎã§. - http://pec.etri.re.kr/!qkim/HTTP/Ïóê ÌïúÍ½Ä Î¾àÏó‚ Ψ½ÏÑúÎèÑ ÏûàÏúºÎãà σ½Ï°ƒÌïòÏûê.) + (역자주. HTTP authentication이란 Web Client에게 ID와 Password를 입력받아, + ê·¸ ID와 Password로 Web문서에 접근을 허가, 불허하는 기능을 말한다. + 자세히 알고 싶다면 RFC1945의 Authentication 부분을 참고하기 바란다. + http://pec.etri.re.kr/!qkim/HTTP/에 한글 번역 문서도 있으니 참조하자.) </simpara> <simpara> - PHP΀º ÏǨÏö©Ìïú HTTP Ïù½Ï¶ùÏùÄ Apache ΁®Îìàΰú ÏǨÏö©ÎêÝ ÎïåÎßå ÎèôÏûëÌïúÎã§. - CGI ξÑÏݺÏóêÏÑúÎäî Ïù¥ ͽƒÎä€ÏùÑ ÏǨÏö©ÌïÝ Ïàò ÏóÜÎã§. - Apache ΁®ÎìàÏùò PHP Ïä§ÌŨζ‡Ìä½ÏóêÏÑú <function>Header</function>ÎùºÎäî Ìï®Ïàò΀º ÏǨÏö©ÌïòΩ¥ - Client νåÎùºÏöƒÏÝÄÏóê;å Usernamë́º Password΀º ÏûÖÎ݀΃õÎäî ÏúàÎèÑÏöƒÎ€º ÎùÑÏöƒÎèÑΰù ÌïòÎäî - "Ïù½Ï¶ù Ïöî͵¨"("Authentication Required") ΩîÏãúÏßÄ΀º ΄¥ÎǺ Ïàò ÏûàÎã§. - ÏùºÎã® ÏǨÏö©ÏûêÍƒÄ Usernamë́º Password΀º ÏûÖÎ݀ÌïòΩ¥, - user name, password, authentication typeÏùò ̓íÏùÑ ÍƒÄÏßÄÎäî - $PHP_AUTH_USER, $PHP_AUTH_PW, $PHP_AUTH_TYPEÏùò 3̓úÏùò ΄ÄÏàò΀º ̓ÄÏßÄÍ„Ý - Ìï¥Îã¼ URL(PHP Ïä§ÌŨζ‡Ìä½Î€º Ìè¨Ìï®Ìïú)Ïù¥ Îã§Ïãú Ώàζ¨ÏõåÏßÑÎã§. - ÌòÑÏû¨ authentication typeÏùÄ "Basic"ÎßåÏù¥ ÏßÄÏõêÎêúÎã§. - ÏûêÏѽÌïú ÏǨÏö©Î¾ïÏùÄ <function>Header</function> Ìï®Ïàò΀º ÏÇ¥Ìé¥ Î„¥Ïûê.</simpara> + PHP를 사용한 HTTP 인증은 Apache 모듈로 사용될 때만 동작한다. + CGI 버젼에서는 이 기능을 사용할 수 없다. + Apache 모듈의 PHP 스크립트에서 <function>Header</function>라는 함수를 사용하면 + Client 브라우저에게 Usernameê³¼ Password를 입력받는 윈도우를 띄우도록 하는 + "인증 요구"("Authentication Required") 메시지를 보낼 수 있다. + 일단 사용자가 Usernameê³¼ Password를 입력하면, + user name, password, authentication type의 값을 가지는 + $PHP_AUTH_USER, $PHP_AUTH_PW, $PHP_AUTH_TYPE의 3개의 변수를 가지고 + 해당 URL(PHP 스크립트를 포함한)이 다시 불리워진다. + 현재 authentication type은 "Basic"만이 지원된다. + 자세한 사용법은 <function>Header</function> 함수를 살펴 보자.</simpara> <para> - client authenticationÏùÑ ÏǨÏö©ÌïòÏó¨ ͅ½ ÏûÖÎ݀Îêú ̓íÏùÑ ÏúÎ݀ÌïòÎäî ÏòàÏÝúÍƒÄ ÏïÑÎûòÏóê ÏûàÎã§. : + client authentication을 사용하여 ê·¸ 입력된 값을 출력하는 예제가 아래에 있다. : <example> <title>HTTP Authentication example</title> <programlisting role="php"> @@ -38,29 +38,29 @@ </example> </para> <para> - Ïó¨Îü¨ÎÑÏùÄ $PHP_AUTH_USER ÏôÄ $PHP_AUTH_PW΀º Îã®ÏàúÌûà ϏúÎ݀ÌïòÎäî ÎåÄÏãÝ, - ÏǨÏö©ÏûêÏùò Ïãù΄ÑÏùÑ ÏúÑÌï¥ usernamë́º password΀º ÏǨÏö©ÌïòͽƒÎ€º ÏõêÌïÝ Í¾ÉÏù¥Îã§. - Ïù¥ÎïåÎäî DatabaseÏóê QueryÌïòͱƒÎÇò ÏßÅÏÝë dbm ÌååÏùºÏóêÏÑú σæÏïÑ΄¥Îäî Îì±Ïùò ΃©Î¾ïÏúºÎ°ú ̓ÄÎä€ÌïÝ Í¾ÉÏù¥Îã§.</para> + 여러분은 $PHP_AUTH_USER 와 $PHP_AUTH_PW를 단순히 출력하는 대신, + 사용자의 식별을 위해 usernameê³¼ password를 사용하기를 원할 것이다. + 이때는 Database에 Query하거나 직접 dbm 파일에서 찾아보는 등의 방법으로 가능할 것이다.</para> <para> - Internet Explorer browserÏóêÏÑúÎäî ξÑͅ½Î°ú Ïù½Ìï¥ HeaderÏùò ÏàúÏÑúÍƒÄ Îß§Ïöƒ ͼåÎã§Î°‚Îã§. - <emphasis>WWW-Authenticate</emphasis>΀º - <errorcode>HTTP/1.0 401</errorcode>΄¥Î㧠ήºÏÝÄ Î„¥ÎÇ¥Îäî ;ÉÏù¥ ÌòÑÏû¨ ̓ÄÎä€Ìïú Ìä½Î¶‚ÏúºÎ°ú ΄¥Ïù½Îã§. + Internet Explorer browser에서는 버그로 인해 Header의 순서가 매우 까다롭다. + <emphasis>WWW-Authenticate</emphasis>를 + <errorcode>HTTP/1.0 401</errorcode>보다 먼저 보내는 것이 현재 가능한 트릭으로 보인다. </para> <simpara> - μÑ΃ÄξàÌò½Ïùò ÏúÝϏúÏùÑ ÏöƒÎݧÌïòÏó¨ HTTPÏóêÏÑú ÏÝú̈́µÌïòÎäî Ïù½Ï¶ùÏùÑ ÏǨÏö©ÌïòÎäî ÎåÄÏãÝ - ͽƒÏ°¥Ïùò Ïô½ÎÄ Ωîϼ¥Îãà϶òÏùÑ ÏǨÏö©ÌïÝ Í¾‡ÏöƒÏóêÎäî ΨºÎ°Ý PHP_AUTH ΄ÄÏàòÎäî ÏѧÏÝïÎêòÏßÄ ÏïäÎäîÎã§. - Ïù¥ÎüƒÍ¾‡Ïöƒ externally-authenticated user΀º ÌôïÏù½Ìïòͽƒ ÏúÑÌï¥ $REMOTE_USER ΄ÄÏàò΀º ÏǨÏö©ÌïÝ Ïàò ÏûàÎã§. + 비밀번호의 유출을 우려하여 HTTP에서 제공하는 인증을 사용하는 대신 + 기존의 외부 메카니즘을 사용할 경우에는 물론 PHP_AUTH 변수는 설정되지 않는다. + 이런경우 externally-authenticated user를 확인하기 위해 $REMOTE_USER 변수를 사용할 수 있다. </simpara> <simpara> - ÏúÝÏùòÌïÝ ÏÝêÏùÄ Ïù½Ï¶ùÏù¥ ÌïÑÏöîÌïú ÌéòÏù¥ÏßÄÏôÄ Ïù½Ï¶ùÏù¥ ÌïÑÏöîÏóÜÎäî ÌéòÏù¥ÏßÄÍƒÄ ÍƒôÏùÄ ÏÑúξÑÏÉÅÏóê ϰ¥Ïû¨ÌïÝ Îïå, - Ïù½Ï¶ùÏù¥ ÌïÑÏöîÏóÜÎäî URLÏùÑ controlÌïÝ Ïàò ÏûàÎäî ÎàÑ͵ƒÍƒÄ̓Ä, - Ïù½Ï¶ùÏù¥ ÌïÑÏöîÌïú URLÏùò ÏïîÌò½Î€º Ìõîτê΄¥Îäî ;ÉÏùÄ ÎßâÏùÑ Ïàò ÏóÜÎã§Îäî ÏÝêÏù¥Îã§. + 유의할 점은 인증이 필요한 페이지와 인증이 필요없는 페이지가 같은 서버상에 존재할 때, + 인증이 필요없는 URL을 control할 수 있는 누군가가, + 인증이 필요한 URL의 암호를 훔쳐보는 것은 막을 수 없다는 점이다. </simpara> <simpara> - NetscapeÏôÄ Internet Explorer ΁®Îëê 401ÏùëÎ㵠χîÎìú΀º ÏÑúξÑÏóêÏÑú ΃õ;åÎêòΩ¥ - local browser windowÏùò authentication cache΀º clearÌïúÎã§. - ϶â, Ïù¥Í¾ÉÏùÄ "log out"̓úÎÖêÏù¥ ÎêòÎäî ;ÉÏúºÎ°ú, ÏǨÏö©ÏûêÎì§Î°ú ÌïòÏó¨Í½à usernamë́º ÏïîÌò½Î€º Îã§Ïãú ÏûÖÎ݀Ìïò;å ÌïúÎã§. - ÏùºÎÄÎäî Ïù¥Í¾ÉÏùÑ ÌܵÌï¥ loginÏùò "time out"Ïù¥ÎÇò "log-out"ξÑÌäºÏùÑ ÎßåÎìúÎäîÎçƒ ÏǨÏö©ÌïúÎã§ + Netscape와 Internet Explorer 모두 401응답 코드를 서버에서 받게되면 + local browser window의 authentication cache를 clear한다. + 즉, 이것은 "log out"개념이 되는 것으로, 사용자들로 하여금 usernameê³¼ 암호를 다시 입력하게 한다. + 일부는 이것을 통해 login의 "time out"이나 "log-out"버튼을 만드는데 사용한다 </simpara> <example> <title>HTTP Authentication example forcing a new name/password</title> @@ -90,12 +90,12 @@ </programlisting> </example> <simpara> - ͅ½Îü¨ÎÇò Ïù¥ ÎèôÏûëÏùÄ HTTP Basic authentication ͽƒÏ§ÄÏóê ΄¥Ïû€Îêú ;ÉÏùÄ ÏïÑÎãàÎØÄΰú Ïù¥ ͽƒÎä€Ïóê Ïùòϰ¥ÌïòÏó¨ÏÑúÎäî ÏïàÎêúÎã§. - LynxÏóêÏÑúÎäî 401 ÏÑúÎ¾Ñ ÏùëÎãµÏùÑ ÎƒõÏïÑÎèÑ authentication ÏÝï΄¥Î€º clearÌïòÏßÄ ÏïäÎäîÎã§. - ÎîƒÎùºÏÑú BackÏùÑ ÎàÑ΀¥Í„Ý Îã§Ïãú Forward ξÑÌäºÏùÑ ÎàåÎü¨ÏÑú Îã§Ïãú ÏÝëͅºÌïÝ Ïàò ÏûàÎã§.</simpara> + 그러나 이 동작은 HTTP Basic authentication 기준에 보장된 것은 아니므로 이 기능에 의존하여서는 안된다. + Lynx에서는 401 서버 응답을 받아도 authentication 정보를 clear하지 않는다. + 따라서 Back을 누르고 다시 Forward 버튼을 눌러서 다시 접근할 수 있다.</simpara> <simpara> - ÎòêÌïú Ïù¥ Authentication ͽƒÎä€ÏùÄ Microsoft's IIS serverÏóêÏÑú - CGI versionÏùò PHP΀º ÏǨÏö©ÌïÝ Í¾‡ÏöƒÏóêÎäî IISÏùò ÏÝúÏï‡ÏúºÎ°úÏù½Ìï¥ ÎèôÏûëÌïòÏßÄ ÏïäÎäîÎã§. + 또한 이 Authentication 기능은 Microsoft's IIS server에서 + CGI version의 PHP를 사용할 경우에는 IIS의 제약으로인해 동작하지 않는다. </simpara> </chapter> <!-- Keep this comment at the end of the file Index: phpdoc/kr/features/images.xml diff -u phpdoc/kr/features/images.xml:1.1 phpdoc/kr/features/images.xml:1.2 --- phpdoc/kr/features/images.xml:1.1 Tue Jan 9 02:58:55 2001 +++ phpdoc/kr/features/images.xml Tue Jan 9 03:27:54 2001 @@ -1,12 +1,12 @@ <chapter id="features.images"> - <title>PHPÏóêÏÑú Ïù¥ÎؽÏßÄ ÏÉùÏѱ̈́º ÏàòÏÝï(Creating and manipulating images)</title> + <title>PHP에서 이미지 생성과 수정(Creating and manipulating images)</title> <simpara> - PHPÎäî Îã®ÏßÄ HTMLϏúÎ݀ÏùÑ ÎßåÎìúÎäî ;ÉÎßå ÌïÝ Ïàò ÏûàÎäî ;ÉÏù¥ ÏïÑÎãàÎã§. - PHPÎäî GIF image fileÎèÑ ÎßåÎì§ Ïàò ÏûàÏùÑ ÏûàÏùÑ ÎøêÏïÑÎãàÎùº, - ÏǨÏö©ÌïòͽƒÏóê Ìé½Î¶¨Ìïú GIF image streamͼåÏßÄ ÎßåÎì§ Ïàò ÏûàÎã§. - Ïù¥Î€º ÏúÑÌï¥ÏÑú Ïó¨Îü¨ÎÑÏùÄ PHP΀º Ϫ¥ÌååÏùº ÌïÝ Îïå, image Ìï®Ïàò΀º ̓ÄÏßÄÍ„Ý ÏûàÎäî GD ÎùºÏù¥Î½åÎü¨Î¶¨Î€º Ìè¨Ìï®ÌïòÏó¨Ïïº ÌïúÎã§. - GDÏôÄ PHPÎäî ÏǨÏö©ÌïòÎäî Ïù¥ÎؽÏßÄ Ìè¨Î߅ ÌòïÌÉúÏóê ÎîƒÎùº Îã§Î€½ ÎùºÏù¥Î½åÎü¨Î¶¨ÎèÑ Ïöî͵¨ÌïúÎã§. - GDÎäî ξÑÏÝÑ 1.6ΏÄÌу GIF Ïù¥ÎؽÏßÄ ÏßÄÏõêÏùÑ ÌïòÏßÄ ÏïäÎäîÎã§. + PHP는 단지 HTML출력을 만드는 것만 할 수 있는 것이 아니다. + PHP는 GIF image file도 만들 수 있을 있을 뿐아니라, + 사용하기에 편리한 GIF image stream까지 만들 수 있다. + 이를 위해서 여러분은 PHP를 컴파일 할 때, image 함수를 가지고 있는 GD 라이브러리를 포함하여야 한다. + GD와 PHP는 사용하는 이미지 포맷 형태에 따라 다른 라이브러리도 요구한다. + GD는 버전 1.6부터 GIF 이미지 지원을 하지 않는다. </simpara> <para> <example> @@ -24,11 +24,11 @@ ?> </programlisting> </example> - ÏúÑÏùò ÏòàÏÝúÎäî &lt;img src=&quot;button.php?text&quot;&gt; ÏôÄ ÍƒôÏùÄ tagÏù¥ ÏûàÎäî ÌéòÏù¥ÏßÄΰúΏÄÌу ΏàÎݧÏßÄ;å ÎêÝ Í¾ÉÏù¥Îã§. - ͅ½Îü¨Î©¥ ÏúÑÏóêÏûàÎäî button.php Ïä§ÌŨζ‡Ìä½Îäî "text"ÎùºÎäî Ψ½ÏûêÏó¥ÏùÑ - "images/button1.gif"Ïóê Ïò§Î¾ÑÎÝàÏù¥ ÏãúϺú ;ƒÍ„º imageÏóê ϏúÎ݀ÌïúÎã§. - Ïù¥ÎÝá;å ÌïòΩ¥ ξÑÌäºÏóê Îì§Ïñ¥ÍƒÄÎäî ͽÄÏî®Î€º Îߧξà ÏÜêÏâ‡Í¾å ΃îÍøî Ïì½ Ïàò Ïûà̈́Ý, - ÎòêÌïú Îߧξà Ïù¥ÎؽÏßÄ ÌååÏùºÏùÑ ÎßåÎì§ ÌïÑÏöîÍƒÄ ÏóÜÏñ¥ Ìö®Ïú®ÏÝÅÏù¥Í„Ý ̓ÑÎã®ÌïòÎã§. + 위의 예제는 &lt;img src=&quot;button.php?text&quot;&gt; 와 같은 tag이 있는 페이지로부터 불려지게 될 것이다. + 그러면 위에있는 button.php 스크립트는 "text"라는 문자열을 + "images/button1.gif"에 오버레이 시켜 ê²°ê³¼ image에 출력한다. + 이렇게 하면 버튼에 들어가는 글씨를 매번 손쉽게 바꿔 쓸 수 있고, + 또한 매번 이미지 파일을 만들 필요가 없어 효율적이고 간단하다. </para> </chapter> <!-- Keep this comment at the end of the file
« previous php.doc (#969333507) next »