Chapter 11 Review:

• How do you write data to a compressed file? (See page 354.)

Writing to a compressed file involves first using gzopen($resource hanlde, mode('r'+num) function, managed similarly to fopen, but allowing the num setting 1-9 to set level of compression from least to most respectively.

Then gzwrite($resource handle)

 

• How do you read data from a compressed file? (See page 354.)

Reading changes the mode above from w to r, and then the special function readgzfile() will read, decompress and send to output.

• What is cron? How do you create new cronjobs? (See page 363.)

Cron jobs are scheduled tasks on Linux/Unix. They are created in the crontab and using a standard editor - although some hosting shells (like Plesk) allow them to be created via a GUI. They use a syntax of minutes hours days months day-of-week to establish running schedule.

• What security concerns surround session data? (See page 366.)

Sessions are usually stored as plaintext files in publicly accessible areas of the server.

• Why are the base64_encode() and base64_decode() functions used in the encryption examples? (See page 366.)

The base64_encode() converts binary to textual data and the decode portion retrieves it - since sessions can not store as binary data.