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

PHP Developer''''s Dictionary- P52 pptx

5 255 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 416,68 KB

Nội dung

PHP Developer’s Dictionary IT-SC book 255 The session_save_path() function returns the path of the directory that session data is currently being saved. If the path is specified, the session data storage will be changed to path. session_id() Syntax session_id([id]); Description The session_id() function returns the session ID for the current session as a string. If id is specified, it will replace the current session ID with that value. session_register() Syntax session_register(name,[ ]); Description The session_register() function registers variables with the current session. This function accepts a variable number of parameters and returns true, 1, if the session variable is successfully registered. The parameters can be a string holding the variable name, an array containing variable names, or arrays themselves. For each variable name sent to session_register() as a parameter, a global variable is created in the current session. session_unregister() Syntax session_unregister(name); Description The session_unregister() function unregisters the variable defined by name from the current session. This function returns true, 1, if the variable is successfully unregistered from the session. PHP Developer’s Dictionary IT-SC book 256 session_is_registered() Syntax session_is_registered(name); Description The session_is_registered() function returns true, 1, if the variable name is registered with the current session. session_decode() Syntax session_decode(data); Description The session_decode() function decodes the string defined by data into variables and inserts these variables into the current session. session_encode() Syntax session_encode(); Description The session_encode() function returns an encoded string containing all current session data and associated variables. URL This section deals with functions that encode, decode, or parse URL data. This is often used when submitting forms to CGI programs or passing variables from a URL to a program. base64_decode() PHP Developer’s Dictionary IT-SC book 257 Syntax base64_decode(encoded_data); Description The base64_decode() function decodes a string defined by encoded_data and returns the original data as a string. base64_encode() Syntax base64_encode(data); Description The base64_encode() function encodes the string defined by data and returns the data as a string in base64 encoding. This encoded string is designed to minimize the corruption of raw binary data. Because of error checking, the encoded string is approximately 33% larger than the original data. Base64 encoding is described in RFC-2045 Table 7.6 illustrates the encoding that occurs. Table 7.6. Base64 Conversions Val Encod Val Encod Val Encod Val Encod 0 A 17 R 34 I 51 z 1 B 18 S 35 j 52 0 2 C 19 T 36 k 53 1 3 D 20 U 37 l 54 2 4 E 21 V 38 m 55 3 5 F 22 W 39 n 56 4 6 G 23 X 40 o 57 5 7 H 24 Y 41 p 58 6 8 I 25 Z 42 q 59 7 9 J 26 a 43 r 60 8 10 K 27 b 44 s 61 9 11 L 28 c 45 t 62 + 12 M 29 d 46 u 63 / 13 N 30 e 47 v 14 O 31 f 48 w (pad) = 15 P 32 g 49 x 16 Q 33 h 50 y PHP Developer’s Dictionary IT-SC book 258 parse_url() Syntax parse_url(url); Description The parse_url() function returns an associative array containing the components of the url. The array will contain one or all of the following elements: • scheme • host • port • user • pass • path • query • fragment urldecode() Syntax urldecode(str); Description The urldecode() function converts str from URL-encoded format into plain text. This places any nonalphanumeric characters, encoded with a percent sign (%) followed by the two-digit hexadecimal ASCII value of the character, back to their character representations. Plus signs are converted to spaces. urlencode() Syntax urlencode(str); PHP Developer’s Dictionary IT-SC book 259 Description The urlencode() function returns a string that has been converted from plain text to URL format. This conversion replaces any nonalphanumeric characters with a percent sign (%) followed by the two-digit hexadecimal ASCII value of the character. Spaces are converted to plus (+) signs. VMailMgr VMailMgr (Virtual Mail Manager) is an assortment of programs designed to manage multiple email domains and mailboxes on a single host. VMailMgr operates in conjunction with the qmail application. qmail is a sendmail alternative that offers more options and program control than sendmail. The following functions build on the established VMailMgr and qmail functionality. For this reason, VMailMgr and qmail must be installed for these functions to work. Resource The qmail application and information are available at http://www.qmail.org . The VMailMgr application and information are available at http://www.vmailmgr.org . vm_adduser() Syntax vm_adduser(vdomain, basepwd, newusername, newuserpassword); Description The vm_adduser() function adds a new virtual user with newusername and newuserpassword to vdomain. The vdomain parameter is defined as the domain name of the user's virtual domain. The string basepwd is the password of the master user that administers the virtual users. This function returns the following: • O—Okay • 1—Bad • 2—Error . PHP Developer’s Dictionary IT-SC book 255 The session_save_path() function returns the path. This function returns true, 1, if the variable is successfully unregistered from the session. PHP Developer’s Dictionary IT-SC book 256 session_is_registered() Syntax session_is_registered(name);. submitting forms to CGI programs or passing variables from a URL to a program. base64_decode() PHP Developer’s Dictionary IT-SC book 257 Syntax base64_decode(encoded_data); Description

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