PHP 4.0 编程指南与样例
分類: 图书,计算机/网络,行业软件及应用,
作者: 武海平 付小龙
出 版 社: 人民邮电出版社
出版时间: 2000-12-1字数: 602版次: 1页数:印刷时间: 20001201开本:印次:纸张:I S B N : 9787115090386包装: 平装内容简介
本书首先介绍了PHP的基础知识和编程的基本原理,包括PHP的发展历史、PHP的安装和PHP语言的基本要素,PHP的常量、变量、运算符号、控制语句和函数。
在此基础上,本书列举了大量PHP的实际应用例子,并提供了相应的源代码。这些例子分为几个专题,包括使用PHP编写聊天室和留言板程序,使用PHP进行用户认证、数据库处理、图形处理和文件的上载与下载等方面的内容,基本上涵盖了目前网站建设中使用到的主流技术。
本书附录给出了PHP4.0常用函数库,使本书还能够作为一本手册供程序员编程的时候查询之用。
本书可以作为PHP语言的学习书籍,也可供程序员、高级程序员参考。
目录
第1章 PHP基础
1.1 PHP的基本概念
1.2 PHP的安装
1.2.1在UNIX操作系统上安装PHP
1.2.2 PHP在Windows95/98/2000/NT上的安装
第2章 PHP变量
2.1 PHP的基本语法结构
2.1.1 PHP的变量类型
2.1.2 PHP的类型转换
2.1.3 PHP的预定义变量
2.1.4 PHP的外部变量
2.1.5 PHP定义的一些常量
2.2 PHP的数组操作函数
array
array_walk
arsort
asort
count
current
each
end
key
ksort
list
next
pos
prev
range
reset
rsort
shuffle
sizeof
sort
uasort
uksort
usort
第3章 表达式、运算符与控制语句
3.1 PHP的表达式
3.2 PHP的运算符
算术运算符
字符串运算符
赋值运算符
位运算符
逻辑运算符
其他运算符号
3.3 PHP的控制流程(语句)
IF 语句
ELSE 语句
ELSEIF 语句
WHILE 语句
DO..WHILE 语句
FOR 语句
BREAK 语句
CONTINUE 语句
SWITCH 语句
REQUIRE 语句
INCLUDE 语句
3.4 PHP的函数
第4章 PHP开发数据库应用
4.1 数据库操作语言--SQL
在表的基本操作中常用SQL命令介绍
4.2 PHP数据库应用范例--留言板
4.3 PHP数据库应用范例--用户认证
4.4 PHP数据库应用范例--自动创建UNIX用户
4.5 常用的PHP操作数据库的函数
PHP操作SQL Server 数据库函数库
MySQL数据库函数库
Oracle 8数据库函数库
Oracle数据库函数库
Sybase数据库函数库
第5章 PHP的安全和用户认证
5.1 通信协议和身份认证
5.1.1 HTTP协议的特点
5.1.2 身份认证在HTTP协议中的困难
5.2 Cookie技术简介
5.2.1 Cookie的概念
5.2.2 Cookie的工作方式
5.2.3 Cookie的属性
5.3 如何在PHP中使用Cookie
5.3.1 设置Cookie
5.3.2 接收和处理Cookie
5.3.3 删除Cookie
5.3.4 使用Cookie的限制
5.4 通过Cookie进行身份认证
5.4.1 身份认证中需要注意的问题
5.4.2 建立身份认证的数据表
5.4.3 身份认证的函数设计和实现
5.4.4 身份认证的PHP脚本
5.5 Session 的使用
5.5.1 Session的概念
5.5.2 Session的工作方式
5.5.3 如何在PHP中使用Session
第6章 PHP一般函数调用
6.1 访问计数器
6.2 聊天室
6.2.1 聊天室的登录
6.2.2 聊天室的显示界面
6.2.3 聊天室在线人数监测
6.2.4 聊天室指挥中心
6.2.5 聊天室的主动更新与被动更新
6.3 文件的上载与下载
6.3.1 文件上载
6.3.2 文件下载
6.4 apache服务器专用函数库
apache_lookup_uri
apache_note
Getallheaders
virtual
6.5 文件系统函数库
basename
chgrp
chmod
clearstatcache
copy
delete
dirname
diskfreespace
fclose
feof
fgetc
fgetcsv
fgets
fgetss
file
file_exists
fileatime
filectime
filegroup
fileinode
filemtime
fileowner
fileperms
filesize
filetype
flock
fopen
fpassthru
fputs
fread
fseek
ftell
fwrite
set_file_buffer
is_dir
is_executable
is_file
is_link
is_readable
is_writeable
link
linkinfo
mkdir
pclose
popen
readfile
readlink
rename
rewind
rmdir
stat
lstat
symlink
tempnam
touch
umask
unlink
6.6 PHP 选项及相关信息函数库
error_log
error_reporting
getenv
get_cfg_var
get_current_user
get_magic_quotes_gpc
get_magic_quotes_runtime
getlastmod
getmyinode
getmypid
getmyuid
getrusage
phpinfo
phpversion
putenv
set_magic_quotes_runtime
set_time_limit
第7章 PHP的图像操作
7.1 使用PHP和GD进行图形处理
7.1.1 基本工作原理
7.1.2 线形图形
7.2 使用VH图形库编写UNIX监控系统
7.3 PHP的图形函数
GetImageSize
ImageArc
ImageChar
ImageCharUp
ImageColorAllocate
ImageColorTransparent
ImageCopyResized
ImageCreate
ImageDestroy
ImageFilledRectangle
ImageFilledPolygon
ImageLine
ImageRectangle
ImageCreateFromGIF
ImageGIF
ImagePNG
ImageCreateFromPNG
第8章 PHP中的日期处理
8.1 日期与时间处理
8.1.1 得到目前的日期和时间
8.1.2 日期和时间的显示形式
8.1.3 转换现在的日期为UNIX的时间戳值
8.1.4 修改日期
8.1.5 为PHP添加DateAdd函数
8.1.6 为PHP添加DateDiff函数
8.2 日期与时间函数库
checkdate
date
strftime
getdate
gettimeofday
gmdate
mktime
gmmktime
time
microtime
附录 PHP4.0常用函数库
程序执行功能函数库
escapeshellcmd
exec
system
passthru
字符串处理函数库
AddSlashes
bin2hex
Chop
Chr
chunk_split
convert_cyr_string
crypt
echo
explode
flush
get_meta_tags
htmlspecialchars
htmlentities
implode
join
ltrim
md5
nl2br
Ord
parse_str
printf
quoted_printable_decode
QuoteMeta
rawurldecode
rawurlencode
setlocale
similar_text
soundex
sprintf
strchr
strcmp
strcspn
strip_tags
StripSlashes
strlen
strrpos
strpos
strrchr
strrev
strspn
strstr
strtok
strtolower
strtoupper
str_replace
strtr
substr
trim
ucfirst
ucwords
变量处理函数库
gettype
intval
doubleval
empty
is_array
is_double
is_float
is_int
is_integer
is_long
is_object
is_real
is_string
isset
settype
strval
unset
IMAP 电子邮件系统函数库
imap_append
imap_base64
imap_body
imap_check
imap_close
imap_createmailbox
imap_delete
imap_deletemailbox
imap_expunge
imap_fetchbody
imap_fetchstructure
imap_header
imap_headers
imap_listmailbox
imap_listsubscribed
imap_mail_copy
imap_mail_move
imap_num_msg
imap_num_recent
imap_open
imap_ping
imap_renamemailbox
imap_reopen
imap_subscribe
imap_undelete
imap_unsubscribe
imap_qprint
imap_8bit
imap_binary
imap_scanmailbox
imap_mailboxmsginfo
imap_rfc822_write_address
imap_rfc822_parse_adrlist
imap_setflag_full
imap_clearflag_full
imap_sort
imap_fetchheader
imap_uid
imap_getmailboxes
imap_getsubscribed
imap_msgno
imap_search
imap_last_error
imap_errors
imap_alerts
imap_status
Informix 数据库函数库
ifx_connect
ifx_pconnect
ifx_close
ifx_query
ifx_prepare
ifx_do
ifx_error
ifx_errormsg
ifx_affected_rows
ifx_getsqlca
ifx_fetch_row
ifx_htmltbl_result
ifx_fieldtypes
ifx_fieldproperties
ifx_num_fields
ifx_num_rows
ifx_free_result
ifx_create_char
ifx_free_char
ifx_update_char
ifx_get_char
ifx_create_blob
ifx_copy_blob
ifx_free_blob
ifx_get_blob
ifx_update_blob
ifx_blobinfile_mode
ifx_textasvarchar
ifx_byteasvarchar
ifx_nullformat
ifxus_create_slob
ifx_free_slob
ifxus_close_slob
ifxus_open_slob
ifxus_tell_slob
ifxus_seek_slob
ifxus_read_slob
ifxus_write_slob
LDAP 目录协议函数库
ldap_add
ldap_mod_add
ldap_mod_del
ldap_mod_replace
ldap_bind
ldap_close
ldap_connect
ldap_count_entries
ldap_delete
ldap_dn2ufn
ldap_explode_dn
ldap_first_attribute
ldap_first_entry
ldap_free_result
ldap_get_attributes
ldap_get_dn
ldap_get_entries
ldap_get_values
ldap_list
ldap_modify
ldap_next_attribute
ldap_next_entry
ldap_read
ldap_search
ldap_unbind
数学运算函数库
Abs
Acos
Asin
Atan
Atan2
base_convert
BinDec
Ceil
Cos
DecBin
DecHex
DecOct
Exp
Floor
getrandmax
HexDec
Log
Log10
max
min
mt_rand
mt_srand
mt_getrandmax
number_format
OctDec
pi
pow
rand
round
Sin
Sqrt
srand
Tan
mcrypt 编码函数库
mcrypt_get_cipher_name
mcrypt_get_block_size
mcrypt_get_key_size
mcrypt_create_iv
mcrypt_cbc
mcrypt_cfb
mcrypt_ecb
mcrypt_ofb
ODBC 数据库链接函数库
mit
odbc_binmode
odbc_close
odbc_close_all
odbc_commit
odbc_connect
odbc_cursor
odbc_do
odbc_exec
odbc_execute
odbc_fetch_into
odbc_fetch_row
odbc_field_name
odbc_field_type
odbc_field_len
odbc_free_result
odbc_longreadlen
odbc_num_fields
odbc_pconnect
odbc_prepare
odbc_num_rows
odbc_result
odbc_result_all
odbc_rollback
odbc_setoption
FTP 文件传输函数库
ftp_connect
ftp_login
ftp_pwd
ftp_cdup
ftp_chdir
ftp_mkdir
ftp_rmdir
ftp_nlist
ftp_rawlist
ftp_systype
ftp_pasv
ftp_get
ftp_fget
ftp_put
ftp_fput
ftp_size
ftp_mdtm
ftp_rename
ftp_delete
ftp_quit
网络函数库
fsockopen
pfsockopen
set_socket_blocking
gethostbyaddr
gethostbyname
gethostbynamel
checkdnsrr
getmxrr
openlog
syslog
closelog
debugger_on
debugger_off
拼写检查函数库
aspell_new
aspell_check
aspell_check-raw
aspell_suggest
BC高精确度函数库
bcadd
bccomp
bcdiv
bcmod
bcmul
bcpow
bcscale
bcsqrt
bcsub
dBase格式表函数库
dbase_create
dbase_open
dbase_close
dbase_pack
dbase_add_record
dbase_delete_record
dbase_get_record
dbase_numfields
dbase_numrecords
目录管理函数库
chdir
dir
closedir
opendir
readdir
rewinddir
filePro数据库函数库
filepro
filepro_fieldname
filepro_fieldtype
filepro_fieldwidth
filepro_retrieve
filepro_fieldcount
filepro_rowcount
HTTP相关函数库
header
setcookie
电子邮件函数库
mhash哈希函数库
mhash_get_hash_name
mhash_get_block_size
mhash_count
mhash
NIS函数库
yp_get_default_domain
yp_order
yp_master
yp_match
yp_first
yp_next
yp_errno
yp_err_string
Perl相容语法函数库
preg_match
preg_match_all
preg_replace
preg_split
正则表达式函数库
ereg
ereg_replace
eregi
eregi_replace
split
sql_regcase
SNMP网管函数库
snmpget
snmpwalk
snmpwalkoid
snmp_get_quick_print
snmp_set_quick_print
URL处理函数库
parse_url
urldecode
urlencode
base64_encode
base64_decode
Session函数库
session_start
session_destroy
session_name
session_module_name
session_save_path
session_id
session_register
session_unregister
session_is_registered
session_decode
session_encode
GNU记录函数库
recode_string
recode_file
信号与共享内存函数库
sem_get
sem_acquire
sem_release
shm_attach
shm_detach
shm_remove
shm_put_var
shm_get_var
shm_remove_var
压缩文件函数库
gzclose
gzeof
gzfile
gzgetc
gzgets
gzgetss
gzopen
gzpassthru
gzputs
gzread
gzrewind
gzseek
gztell
readgzfile
gzwrite
XML解析函数库
xml_parser_create
xml_set_object
xml_set_element_handler
xml_set_character_data_handler
xml_set_processing_instruction_handler
xml_set_default_handler
xml_set_unparsed_entity_decl_handler
xml_set_notation_decl_handler
xml_set_external_entity_ref_handler
xml_parse
xml_get_error_code
xml_error_string
xml_get_current_line_number
xml_get_current_column_number
xml_get_current_byte_index
xml_parser_free
xml_parser_set_option
xml_parser_get_option
utf8_decode
utf8_encode