Learn PHP In a Day | Php Cookbook With Examples And Solutions |
The next two recipes demonstrate how to use authentication, which lets you protect your web pages with passwords. PHP’s special features for dealing with HTTP Basic authentication are explained in Recipe 8.9. Sometimes it’s a better idea to roll your own authentication method using cookies, as shown in Recipe 8.10
The three following recipes deal with output control. Recipe 8.11 shows how to force output to be sent to the browser. Recipe 8.12 explains the output buffering functions. Output buffers enable you to capture output that would otherwise be printed or delay output until an entire page is processed. Automatic compression of output is shown in Recipe 8.13.
Recipes 8.14 to 8.19 cover error handling topics, including controlling where errors are printed, writing custom functions to handle error processing, and adding debugging assistance information to your programs. Recipe 8.18 includes strategies for
avoiding the common “headers already sent” error message, such as using the output buffering discussed in Recipe 8.12.
The next four recipes show how to interact with external variables: environment variables and PHP configuration settings. Recipes 8.20 and 8.21 discuss environment variables, while Recipes 8.22 and 8.23 discuss reading and changing PHP configuration settings. If Apache is your web server, you can use the techniques in Recipe 8.24 to communicate with other Apache modules from within your PHP programs. Recipe 8.25 demonstrates a few methods for profiling and benchmarking your code. By finding where your programs spend most of their time, you can focus your development efforts on improving the code that has the most noticeable speed-up effect to your users. This chapter also includes two programs that assist in web site maintenance. Program 8.26 validates user accounts by sending an email message with a customized link to each new user. If the user doesn’t visit the link within a week of receiving the message, the account is deleted. Program 8.27 monitors requests in real time on a per-user basis and blocks requests from users that flood your site with traffic.
avoiding the common “headers already sent” error message, such as using the output buffering discussed in Recipe 8.12.
The next four recipes show how to interact with external variables: environment variables and PHP configuration settings. Recipes 8.20 and 8.21 discuss environment variables, while Recipes 8.22 and 8.23 discuss reading and changing PHP configuration settings. If Apache is your web server, you can use the techniques in Recipe 8.24 to communicate with other Apache modules from within your PHP programs. Recipe 8.25 demonstrates a few methods for profiling and benchmarking your code. By finding where your programs spend most of their time, you can focus your development efforts on improving the code that has the most noticeable speed-up effect to your users. This chapter also includes two programs that assist in web site maintenance. Program 8.26 validates user accounts by sending an email message with a customized link to each new user. If the user doesn’t visit the link within a week of receiving the message, the account is deleted. Program 8.27 monitors requests in real time on a per-user basis and blocks requests from users that flood your site with traffic.
No comments:
Post a Comment
Are you seeking some rare EBooks?
Mention here, we will try to share them.