<<

. 127
( 132 .)



>>

existing, testing for (IS_DIR()), 174 random, picking (ARRAY_RAND()), 162“163
functions, 621 removing specific from arrays
name, returning (DIRNAME()), 174 (ARRAY_SPLICE()), 156“157
names, character separating Ellison, Larry (Oracle founder), 3
(path_separator()), HTML survey, 292 email
disconnecting, Guestbook library address
(MYSQL_DBCONNECT()), 242“243 identifying customer by
display (find_customer()), 457“459
active projects in project management, validating versus non-validating, 266
544“545 message, sending to customer
file contents, 553 (notify_customer()), 461“462
image matching catalog product validation, 682“688
(THUMBNAIL()), 430 empty
threaded discussion (display_kids()), properties, leaving out (DATA_FIELDS()), 418
321“326 setting, testing variables for, 112“113
XML parsing, 512“518 variable functions, 148“149
DNS functions, 621“622 encoding
document, Web server, 688“690 character-set value (CHARSET()), 238“239
documentation, PHP functions, 136“137 control characters, undoing in URL
dollar sign ($), 91 functions (base64_decode()), 186
domain-socket connection (fsock), 627 undoing URL functions (urldecode()), 185
double numbers, testing for (is_double()), 113 URL functions (urlencode()), 185
double quotes (“), 94 encryption
double-precision floating-point numbers certificates, 481“482
(double/doubleprecision/real), 35 described, 480“481
do...while loop, 129 password, 235, 732
duplicate data public-key/private-key, 481
joining tables, 85“86 tools, 482
removing (distinct clause), 70 end
array, adding elements to (ARRAY_PUSH()),
E 160
file pointer reading to (FREAD()), 172
e (base of natural logarithms) raised to the
form, 673
power of X (EXP), 704
end of file, testing (FEOF()), 172
eBook version of text, 560
E-NOTICE level error message, 92
editing survey questions
entries
(admin/questions.php), 298“303
deleting, 257“259
editorial review, content-management system
PHP configuration, 580“581
(content/story.php), 392“394
Index 743

problem script (problem.php), 464“465 expr, 733“734
viewing, 255“257 eXtensible Markup Language. See XML parsing
enum field, array, returning values defined in extensions, listing loaded, 189
(enum_to_array()), 679“680 external files, including
envelope, SOAP (Simple Object Access described, 197“199
Protocol), 520“521 only once, 199“200
equals sign (=), 92 required files, 199
error functions
F
custom functions, specifying
(set_error_handler()), 187 false. See true or false
logging (error_log()), 186“187 fields, 417“418
PHP, 186“187 file
reporting level (error_reporting()), 186 adding automatically, 581“582
user-level error message, sending contents, displaying, 553
(trigger_error() and user_error()), form field, 674
187 functions, working with, 623“625
error-handling project management database, 543“544
content-management system status, 625“626
(db_error_handler()), 368“369 uploading, 409“410, 545, 552
threaded discussion viewing, 545
constant, defining to use in bitmask file pointer
(get_constant()), 345“347 closing (FCLOSE()), 172
described, 332“333 opening to indicated file or URL (FOPEN()),
function, calling when error occurs 171“172
(error_handler()), 337“345 reading to specified number of bytes or to
level displayed and logged, 333 the end (FREAD()), 172
simplifying (push_handler() and file system
pop_handler()), 337 absolute pathname, returning (REALPATH()),
tracking responses to types, 333“336 175
escape codes, translating characters into catalog, accessing, 408
(HTMLENTITIES() and checks and then moves uploaded file
HTMLSPECIALCHARS()), 139 (MOVE_UPLOADED_FILE()), 175
escape sequences, character, 54 close pointer to file (FCLOSE()), 172
examining database (show command) copying (COPY()), 173“174
columns, viewing, 46 described, 170
index, viewing, 46“47 end of file, testing (FEOF()), 172
server, availability on, 44“45 existence, testing for (FILE_EXISTS()), 173
statement used to create table, 47“48 file name, creating (TEMPNAM()), 174
table status, 47 file pointer, opening to indicated file or URL
exceptions, object-oriented programming, 219“220 (FOPEN()), 171“172
executing HTTP, whether uploaded
code stored in variable, executing (eval()), (IS_UPLOADED_FILE()), 174
176 path elements, cutting off all but base
functions, 622 (BASENAME()), 175
time, 581 PHP functions, 170“175
existence, testing for reading from file pointer to specified
directory (IS_DIR()), 174 number of bytes or to the end
file (FILE_EXISTS()), 173 (FREAD()), 172
of script control functions reading line by line (FILE()), 173
(function_exists()), 177 continued
744 Index

file system continued input, blocking vandals, 231“234
single line indicated by pointer (FGETS()), PHP functions, 134
172“173 problem-tracking system
unmask value, setting (UMASK()), 173 (problem_entry_form.php), 465“466
value of string argument, writing to file formatting
(FWRITE()), 172 ASCII string (ORD), 709
filtering, array functions, 157“158 date and time
finding current time as seconds (TIME_TO_SEC),
stories by author in content-management 730
system (function fetch_author()), full name of month, 721
378 full name of weekday (DAYNAME), 721
user postings in content-management hour, 722
system (fetch_user()), 378“379 hour, minute, second (time), 37
value (isset()), 112 setting (DATE_FORMAT), 726“728
first element, return and remove two-digit year (year[(2|4)]), 37
(ARRAY_SHIFT()), 160 week beginning with Monday index
first normal form, 10“11 (WEEKDAY), 720
floating-point number week beginning with Sunday index
converting to formatted string (DAYOFWEEK), 719“720
(NUMBER_FORMAT()), 154 week of year (YEARWEEK), 722
double-precision, storing (double/ year, 722
doubleprecision/real), 35 year, month, day, 36
numeric columns, storing, 34“35 year, month, day, time, 36
rounding down (floor()), 149 shopping cart database variable
scalar, returning as (FLOATVAL()), 153 (SESSION_ENCODE()), 485
testing (is_double()), 113 string according to C-style pattern
flow control, 700“702 (SPRINTF()), 166
Flush commands, 590“591 U.S. dollar value (money()), 670
font tag, HTML element functions, 671 from, replacing with to in string (REPLACE), 716
for loop, 129“130 FTP functions, 641“643
foreach loop, 130“131 function. See also specific functions listed by
foreign key, 19“20 type
form BC math, 640
data, inserting into database calling when error occurs
(create_topic()), 329“332 (error_handler()), 337“345
elements calls, indenting, 194“196
checkbox, 675 displayed and described (display_kids()),
ending, 673 321“326
file field, 674 execution, 622
hidden element, 674 GROUP BY clause, 733“734
image, 675 incremental value, returning last
password field, 674 automatically generated, 732
radio button, 675 reusable, threaded discussion, 321
reset, 675 timeout lock, 732“733
select (popup) field, 675
G
starting, 673
submit field, 674 gate-keeping. See security
text, 673 GD functions, 644“650
text box (textarea_field()), 673“674 GD library configuration (IMAGETYPES()), 183
text field, 674 global variables, 205“208, 580
Index 745

grant statement, user administration, 602“604 navigational elements, creating (NAV()),
graphical user interface. See GUI database tools 254“255
graphics. See image queries, writing safely
group by and aggregate functions (SAFE_MYSQL_QUERY()), 243“244
average (avg()), 78“79 query, printing (PRINT_ENTRY()),
counting number of rows in each group 248“249
(count() function), 74“77 user authentication
grouped rows, restricting (having (GUESTBOOK_AUTHENTICATE()),
predicate), 80 244“248
highest value, removing (max() function), 78 verifying user information
lowest value, removing (min() function), 78 (CREATE_ENTRY()), 250“253
subset of columns, grouping (group by necessary pages, 230“231
options), 79“80 scripts, 259
sum of given column, returning (sum() title tags (MAKE_PAGE_TITLE()), 240
function), 77“78 GUI (graphical user interface) database tools,
grouping, caption for (legend), HTML form 48“52
input, 569
H
Guestbook 2003
application, designing, 229“230 handlers, session, 485
code overview, 235“236 hash, one-way string (CRYPT()), 139
database call, putting together header
(SELECT_ENTRIES()), 253“254 file, Barnes & Noble application, 529
database design, 234“235 functions, 627
defensive and text-handling functions Guestbook 2003 (FROM /GUESTBOOK2K/
character-set-encoding value HEADER.PHP), 240“241
(CHARSET()), 238“239 HTML, typical, 197
constant (FROM /GUESTBOOK2K/ HTTP, PHP functions, 179“181
GLOBALS.PHP), 241“242 including, 255“256
header (FROM /GUESTBOOK2K/ Heap, 41
HEADER.PHP), 240“241 height, image (GETIMAGESIZE()), 181
malicious text, barring heredoc syntax, 95
(CLEANUP_TEXT()), 239 hexadecimal value (HEX), 711
reversing text cleanup hidden element, form, 674
(REVERSE_CLEANUP_TEXT()), highest value, removing (max() function), 78
239“240 hot key. See access key
title tags (MAKE_PAGE_TITLE()), 240 hours, formatting, 37, 722
described, 229 HTML (HyperText Markup Language)
entries, 255“259 break, adding after each newline (NL2BR()),
form input, blocking vandals, 231“234 141“142
general utility functions, 236“238 element functions
header (FROM /GUESTBOOK2K/HEADER.PHP), anchor tag, 671
240“241 font tag, 671
library, viewing (FROM /GUESTBOOK2K/ image tag, 671
FUNCTIONS.PHP) paragraphs, 672
arguments, printing subtitles, 672
(PRINT_INPUT_FIELDS()), 249“250 unordered (bulleted list) (ul_list()), 672
database call, putting together escape codes, translating characters into
(SELECT_ENTRIES()), 253“254 (HTMLENTITIES() and
disconnecting (MYSQL_DBCONNECT()), HTMLSPECIALCHARS()), 139
242“243 continued
746 Index

HTML (HyperText Markup Language) continued PHP functions, 179“181
forms text, blocking further headers
access key, 568 (header_sent()), 180
browser-passed variables, accessing, HyperText Markup Language. See HTML
100“102
I
buttons with text and image, 569
caption for grouping (legend), 569 ID
opening and closing tags (form), customer, problem-tracking system
561“562 (fetch_customer()), 454“455
overview, 562“565 getting catalog record by
select, multiple select, 565“566 (FETCH_FROM_DB()), 416“417
Tab key (tabindex), 568 of new catalog image (UPLOAD()), 430
text entry (textarea), 566“567 identifier, 76
text surrounded by thin line (fieldset), if statement
569 checking against several conditions
4.0 character entity references, 696 (if...elseif statement), 125“126
functions, 627“628 comparison operators, 122
removing tags complex, 123“124
general(cleanup_text()), 669 described, 701
string for use as (make_page_title()), syntax, 117“118
670 true or false, determining, 118“122
string (STRIP_TAGS()), 137“138 when condition is false (if...else
survey statement), 125
arguments, handling, 276“281 IFNULL flow control, 700“701
character separating directory names image
(path_separator()), 292 catalog
checkbox, default status, 290“291 extending, 432“433
directory, adding to default path ID value of new (UPLOAD()), 430
(ADD_TO_INCLUDE_PATH()), 292“293 matching display (THUMBNAIL()), 430
initialization code, 293“294 products (IMG()), 429“430
site configuration, sharing information HTML form, 569, 671, 675
(book_constants()), 291 PHP functions
tags, creating common (FROM /BOOK/ copying part of (IMAGECOPYRESIZED()),
FUNCTIONS/HTML/), 281“289 181“182
text field, printing, 289“290 creating new from image stream
tables (IMAGECREATEFROMSTRING()), 182
cell tag, 673 dimensions, 182
closing tag, 672 GD library configuration
inside paragraph tags (start_table()), (IMAGETYPES()), 183
672 outputting in PNG format (IMAGEPNG()),
row tags, 672“673 182
user-defined functions, 671“673 thumbnails, retrieving as data stream
HTTP (HyperText Transfer Protocol) file, testing (EXIF_THUMBNAIL()), 183
(IS_UPLOADED_FILE()), 174 type, checking (EXIF_IMAGETYPE()),
HTTP (HyperText Transfer Protocol) header 183
browser or other HTTP servers, width, height, type, and text string
communicating with (header()), (GETIMAGESIZE()), 181
179“180 incremental value, returning last automatically
cookie, setting (setcookie()), 180 generated, 732
functions, 627
Index 747

indenting with SQL statement, 676“677
code blocks, 192“194 strings, 717
described, 191 installation, MySQL/PHP
function calls, 194“196 Unix/Mac OS X, 575“580
SQL statements, 196“197 Windows (Microsoft), 571“575
index integer
adding, 43 ASCII-code values of (CHAR), 711
columns, creating, 37“38 rounding to integer with specified number
described, 26 of decimal places (ROUND), 704
dropping, 43 scalar, returning (INTVAL()), 153
string (FIELD), 718 storing (int/integer, tinyint,

<<

. 127
( 132 .)



>>