1. Trang chủ
  2. » Công Nghệ Thông Tin

PHP Developer''''s Dictionary- P41 ppt

5 309 0

Đang tải... (xem toàn văn)

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 5
Dung lượng 364,87 KB

Nội dung

PHP Developer’s Dictionary IT-SC book 200 Description The ftp_rmdir() function deletes directory in the current working directory of ftp_stream , which is the name handle of a previously opened stream using ftp_connect() . If successful, 1 is returned. If the function is unsuccessful, 0 is returned. ftp_site() Syntax int ftp_site(int ftp_stream, string command) Description The ftp_site() function, which was added in PHP 3.0.15, sends command to the machine connected to through ftp_stream . Because the function actually passed a SITE FTP command, the commands that can be executed vary depending on the server. ftp_size() Syntax int ftp_size(int ftp_stream, string remote_file) Description The ftp_size() function returns the size of remote_file connected to by ftp_stream . If an error occurs, –1 is returned. Note Not all FTP servers support this feature. ftp_systype() Syntax PHP Developer’s Dictionary IT-SC book 201 int ftp_systype(int ftp_stream) Description The ftp_systype() function, when successful, returns the system type identifier of the remote machine that is connected to through ftp_stream . If the function fails, 0 is returned. The following line will write this information based on the connection defined by $my_conn : echo ftp_systype($my_conn); HTTP The Hypertext Transfer Protocol (HTTP) is another standard Internet protocol. It is generally used to transfer the Hypertext Markup Language (HTML) pages and related elements, such as images, that make up today's Web pages. You can find more information on HTTP at http://www.w3.org/Protocols and more information on HTML at http://www.w3.org/MarkUp . Note This library of functions was added in PHP 3. header() Syntax int header(string header_directive) Description The header() function enables you to specify a single header directive, in header_directive , when fulfilling HTTP requests. If you want to specify several directives, you have to use this function multiple times. When specifying header information, you must send it before sending the HTTP body of the request. For instance, you can pass back a "Location: /newpage.html" if you want to redirect users to newpage.html rather than the page they requested. For more information on HTTP headers, you can read the Request For Comments (RFC) at http://www.ietf.org/rfc/rfc2616.txt . setcookie() PHP Developer’s Dictionary IT-SC book 202 Syntax int setcookie(string name, [string value], [int expire], [string path], [string domain], [int secure]) Description The setcookie() function, which must be sent before any headers (see header()), enables you to set a cookie ( name ) with a specific value . You also can set when the cookie expires and what path has the right to read it under what domain . To format expire correctly, you can use the UNIX time integer as returned by the time() or mktime() function. The domain field can hold an absolute machine and domain name, such as "machine.domain.com" or it can hold just the domain portion (if you want all machines to be able to read the cookie in that domain), such as ".domain.com". Finally, secure takes a 1 or 0 to signify whether the cookie should be transmitted over HTTPS (secure) connections. Note You must be within the domain to set a cookie. Although PHP might try to set the cookie, the browser will not accept it. In other words, you can't build a PHP application to run on http://www.mcp.com and set a cookie readable by .php.net . IMAP, POP3, and NNTP The Internet Message Access Protocol (IMAP) and Post Office Protocol version 3 (POP3) are used for email, and the Network News Transfer Protocol (NNTP) performs tasks that revolve around newsgroups. All these are standard Internet protocols that focus on different types and methods of messaging. You can read the Request For Comments (RFC) on NNTP at http://www.ietf.org/rfc/rfc0977.txt; on IMAP at http://www.ietf.org/rfc/rfc2192.txt; and on POP3 at http://www.ietf.org/rfc/rfc2384.txt . Because of the semantics of creating and checking emails and mailboxes, we highly recommend that you read through these specifications. Otherwise, many of the terms and overall functioning defined in this section might not be clear. Note Although all the PHP functions in this section start with imap_ , they are not limited to just IMAP, as the title of the section indicates. Also, it is worth noting that this library of functions was added in PHP 3. PHP Developer’s Dictionary IT-SC book 203 To get these extensions to work, you must compile PHP with the with-imap parameter, which requires a C IMAP library to work. You can obtain the latest and greatest version of this library from ftp://ftp.cac.washington.edu/imap . imap_8bit() Syntax string imap_8bit(string string) Description The imap_8bit() function takes an 8-bit string and returns a quoted-printable string according to section 6.7 in the Request For Comments (RFC) 2045. You can read more about this at http://www.ietf.org/rfc/rfc2045.txt . imap_8bit(' '); //passing a tab returns "=09" imap_alerts() Syntax array imap_alerts() Description The imap_alerts() function, which was added in PHP 3.0.12, returns an array of all IMAP alert messages that have occurred since the last call to the function. imap_append() Syntax int imap_append(int imap_stream, string mailbox, string message, [string flags]) Description PHP Developer’s Dictionary IT-SC book 204 The imap_append() function appends a string message to a specified mailbox . If the function is successful, 1 is returned; otherwise, 0 is returned on an error. If the optional flags are passed, they are written to mailbox as well. Note When using a Cyrus IMAP server, you must use "\ r\ n" to signify your End Of Line (EOL) instead of the normal "\ n". Not doing so will cause the operation to fail. imap_base64() Syntax string imap_base64(string text) Description The imap_base64() function takes Base64-encoded text and decodes it. If you want to read more about Base64 encoding, see section 6.8 The imap_base64() function takes Base64-encoded text and decodes it. If you want to read more about Base64 encoding, see in the Request For Comments (RFC) 2045 at http://www.ietf.org/rfc/rfc2045.txt . imap_binary() Syntax string imap_binary(string string); Description The imap_binary() function, which was added in PHP 3.0.2, takes the 8-bit text and returns a Base64 string. If you want to read more about Base64 encoding, see section 6.8 in the Request For Comments (RFC) 2045 at http://www.ietf.org/rfc/rfc2045.txt . imap_body() Syntax . Although PHP might try to set the cookie, the browser will not accept it. In other words, you can't build a PHP application to run on http://www.mcp.com and set a cookie readable by .php. net that this library of functions was added in PHP 3. PHP Developer’s Dictionary IT-SC book 203 To get these extensions to work, you must compile PHP with the with-imap parameter, which. occurs, –1 is returned. Note Not all FTP servers support this feature. ftp_systype() Syntax PHP Developer’s Dictionary IT-SC book 201 int ftp_systype(int ftp_stream) Description The

Ngày đăng: 07/07/2014, 05:20

TỪ KHÓA LIÊN QUAN