CVS update: php3/doc/chapters
| From: | eschmid | Date: | Sat, 26 Dec 1998 12:59:42 +0000 |
| Subject: | CVS update: php3/doc/chapters | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-3047@lists.php.net to get a copy of this message | ||
Date: Saturday December 26, 1998 @ 7:59
Author: eschmid
Update of /repository/php3/doc/chapters
In directory asf:/u/temp/cvs-serv28528
Modified Files:
features.sgml
Log Message:
Cleanup some linke breakings and add Empress.
Index: php3/doc/chapters/features.sgml
diff -c php3/doc/chapters/features.sgml:1.20 php3/doc/chapters/features.sgml:1.21
*** php3/doc/chapters/features.sgml:1.20 Wed Dec 9 21:07:27 1998
--- php3/doc/chapters/features.sgml Sat Dec 26 07:59:41 1998
***************
*** 4,9 ****
--- 4,10 ----
<sect1 id="feature-httpauth">
<title>HTTP authentication with PHP</title>
+
<simpara>
The HTTP Authentication hooks in PHP are only available when it is
running as an Apache module. In an Apache module PHP script, it
***************
*** 18,26 ****
<para>
An example script fragment which would force client authentication
on a page would be the following:
<example>
<title>HTTP Authentication example</title>
! <programlisting role=php>
<?php
if(!isset($PHP_AUTH_USER)) {
Header("WWW-Authenticate: Basic realm=\"My Realm\"");
--- 19,28 ----
<para>
An example script fragment which would force client authentication
on a page would be the following:
+
<example>
<title>HTTP Authentication example</title>
! <programlisting role=php>
<?php
if(!isset($PHP_AUTH_USER)) {
Header("WWW-Authenticate: Basic realm=\"My Realm\"");
***************
*** 32,38 ****
echo "You entered $PHP_AUTH_PW as your password.<P>";
}
?>
! </programlisting></example>
<para>
Instead of simply printing out the $PHP_AUTH_USER and
$PHP_AUTH_PW, you would probably want to check the username and
--- 34,42 ----
echo "You entered $PHP_AUTH_PW as your password.<P>";
}
?>
! </programlisting>
! </example>
!
<para>
Instead of simply printing out the $PHP_AUTH_USER and
$PHP_AUTH_PW, you would probably want to check the username and
***************
*** 50,78 ****
traditional external mechanism, the PHP_AUTH variables will not be
set if external authentication is enabled for that particular
page. In this case, the $REMOTE_USER variable can be used to
! identify the externally-authenticated user.
<simpara>
Note, however, that the above does not prevent someone who
controls a non-authenticated URL from stealing passwords from
authenticated URLs on the same server.
<simpara>
! Both Netscape and Internet Explorer will clear the local browser window's
! authentication cache for the realm upon receiving a server response of 401. This
! can effectively "log out" a user, forcing them to re-enter their username and
! password. Some people use this to "time out" logins, or provide a "log-out"
! button.
! <simpara>
! This behavior is not required by the HTTP Basic authentication standard, so you
! should never depend on this. Testing with Lynx has shown that Lynx does not clear
! the authentication credentials with a 401 server response, so pressing back and
! then forward again will open the resource (as long as the credential requirements
! haven't changed).
<simpara>
! Also note that this does not work using Microsoft's IIS server
! and the CGI version of PHP due to a limitation of IIS.
<sect1 id="feature-images">
<title>GIF creation with PHP</title>
<simpara>
PHP is not limited to creating just HTML output. It can also be
used to create GIF image files, or even more convenient GIF image
--- 54,85 ----
traditional external mechanism, the PHP_AUTH variables will not be
set if external authentication is enabled for that particular
page. In this case, the $REMOTE_USER variable can be used to
! identify the externally-authenticated user.
<simpara>
Note, however, that the above does not prevent someone who
controls a non-authenticated URL from stealing passwords from
authenticated URLs on the same server.
<simpara>
! Both Netscape and Internet Explorer will clear the local browser
! window's authentication cache for the realm upon receiving a
! server response of 401. This can effectively "log out" a user,
! forcing them to re-enter their username and password. Some people
! use this to "time out" logins, or provide a "log-out" button.
! <simpara>
! This behavior is not required by the HTTP Basic authentication
! standard, so you should never depend on this. Testing with Lynx
! has shown that Lynx does not clear the authentication credentials
! with a 401 server response, so pressing back and then forward
! again will open the resource (as long as the credential
! requirements haven't changed).
<simpara>
! Also note that this does not work using Microsoft's IIS server and
! the CGI version of PHP due to a limitation of IIS.
+
<sect1 id="feature-images">
<title>GIF creation with PHP</title>
+
<simpara>
PHP is not limited to creating just HTML output. It can also be
used to create GIF image files, or even more convenient GIF image
***************
*** 80,88 ****
image functions for this to work.
</simpara>
<para>
! <example>
! <title>GIF creation with PHP</title>
! <programlisting role=php>
<?php
Header("Content-type: image/gif");
$string=implode($argv," ");
--- 87,95 ----
image functions for this to work.
</simpara>
<para>
! <example>
! <title>GIF creation with PHP</title>
! <programlisting role=php>
<?php
Header("Content-type: image/gif");
$string=implode($argv," ");
***************
*** 93,99 ****
ImageGif($im);
ImageDestroy($im);
?>
! </programlisting></example>
This example would be called from a page with a tag like: <img
src="button.php3?text"> The above button.php3 script
--- 100,107 ----
ImageGif($im);
ImageDestroy($im);
?>
! </programlisting>
! </example>
This example would be called from a page with a tag like: <img
src="button.php3?text"> The above button.php3 script
***************
*** 105,134 ****
dynamically generated.
</para>
<sect1 id="feature-fileupload">
<title>File upload support</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 later without a
! patch). This feature lets people upload both text and binary files.
! With PHP's authentication and file manipulation 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>
A file upload screen can be built by creating a special form which
looks something like this:
! <example>
! <title>File Upload Form</title>
! <programlisting>
! <FORM ENCTYPE="multipart/form-data" ACTION="_URL_"
METHOD=POST>
! <INPUT TYPE="hidden" name="MAX_FILE_SIZE"
value="1000">
! Send this file: <INPUT NAME="userfile"
TYPE="file">
! <INPUT TYPE="submit" VALUE="Send File">
! </FORM>
! </programlisting></example>
The _URL_ should point to a php html file. The MAX_FILE_SIZE
hidden field must precede the file input field and its value is
--- 113,145 ----
dynamically generated.
</para>
+
<sect1 id="feature-fileupload">
<title>File upload support</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
! later without a patch). This feature lets people upload both text
! and binary files. With PHP's authentication and file manipulation
! 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>
A file upload screen can be built by creating a special form which
looks something like this:
! <example>
! <title>File Upload Form</title>
! <programlisting>
! <FORM ENCTYPE="multipart/form-data" ACTION="_URL_"
METHOD=POST>
! <INPUT TYPE="hidden" name="MAX_FILE_SIZE"
value="1000">
! Send this file: <INPUT NAME="userfile"
TYPE="file">
! <INPUT TYPE="submit" VALUE="Send File">
! </FORM>
! </programlisting>
! </example>
The _URL_ should point to a php html file. The MAX_FILE_SIZE
hidden field must precede the file input field and its value is
***************
*** 184,199 ****
logic, you should either delete the file from the temporary
directory or move it elsewhere.
<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>
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.
<sect1 id="feature-cookies">
<title>HTTP cookie support</title>
<para>
PHP transparently supports HTTP cookies. Cookies are a mechanism
for storing data in the remote browser and thus tracking or
--- 195,212 ----
logic, you should either delete the file from the temporary
directory or move it elsewhere.
<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>
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.
+
<sect1 id="feature-cookies">
<title>HTTP cookie support</title>
+
<para>
PHP transparently supports HTTP cookies. Cookies are a mechanism
for storing data in the remote browser and thus tracking or
***************
*** 210,224 ****
the <function>setcookie</function> function.
</sect1>
<sect1 id="feature-databases">
<title>Database support</title>
<para>
! PHP supports a number of different databases in both native mode and
! through ODBC, including:
<simplelist columns=2>
<member>Adabas D</member>
<member>dBase</member>
<member>FilePro</member>
<member>Informix</member>
<member>InterBase</member>
--- 223,240 ----
the <function>setcookie</function> function.
</sect1>
+
<sect1 id="feature-databases">
<title>Database support</title>
+
<para>
! PHP supports a number of different databases in both native mode
! and through ODBC, including:
<simplelist columns=2>
<member>Adabas D</member>
<member>dBase</member>
+ <member>Empress</member>
<member>FilePro</member>
<member>Informix</member>
<member>InterBase</member>
***************
*** 231,270 ****
<member>Velocis</member>
<member>Unix dbm</member>
</simplelist>
- </para>
<sect1 id="feature-regexps">
<title>Regular expressions</title>
<para>
! Regular expressions are used for complex string manipulation in PHP. The functions
! that support regular expressions are:
! <itemizedlist>
<listitem>
! <simpara><function>ereg</function>
! </listitem>
<listitem>
! <simpara><function>ereg_replace</function>
! </listitem>
<listitem>
! <simpara><function>eregi</function>
! </listitem>
<listitem>
! <simpara><function>eregi_replace</function>
! </listitem>
<listitem>
! <simpara><function>split</function>
! </listitem>
! </itemizedlist>
! These functions all take a regular expression string as their first argument. PHP uses
! the POSIX extended regular expressions as defined by POSIX 1003.2. For a full description
! of POSIX regular expressions see the regex man pages included in the regex directory in
! the PHP distribution.
! </para>
<para>
! <example>
! <title>Regular expression examples</title>
! <programlisting>
ereg("abc",$string);
/* Returns true if "abc"
is found anywhere in $string. */
--- 247,290 ----
<member>Velocis</member>
<member>Unix dbm</member>
</simplelist>
+
<sect1 id="feature-regexps">
<title>Regular expressions</title>
+
<para>
! Regular expressions are used for complex string manipulation in
! PHP. The functions that support regular expressions are:
!
! <itemizedlist>
<listitem>
! <simpara><function>ereg</function>
! </listitem>
<listitem>
! <simpara><function>ereg_replace</function>
! </listitem>
<listitem>
! <simpara><function>eregi</function>
! </listitem>
<listitem>
! <simpara><function>eregi_replace</function>
! </listitem>
<listitem>
! <simpara><function>split</function>
! </listitem>
! </itemizedlist>
!
! These functions all take a regular expression string as their
! first argument. PHP uses the POSIX extended regular expressions
! as defined by POSIX 1003.2. For a full description of POSIX
! regular expressions see the regex man pages included in the regex
! directory in the PHP distribution.
!
<para>
! <example>
! <title>Regular expression examples</title>
! <programlisting>
ereg("abc",$string);
/* Returns true if "abc"
is found anywhere in $string. */
***************
*** 295,302 ****
ereg_replace("\n","",$string);
/* Get rid of any carriage return
characters in $string. */
! </programlisting></example>
! </para>
<sect1 id="feature-error-handling">
<title>Error handling</title>
--- 315,323 ----
ereg_replace("\n","",$string);
/* Get rid of any carriage return
characters in $string. */
! </programlisting>
! </example>
!
<sect1 id="feature-error-handling">
<title>Error handling</title>
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net