tailieunhanh - PHP Developer's Dictionary- P7
PHP Developer's Dictionary- P7:PHP is an open source, server-side, HTML-embedded scripting language used to create dynamically generated Web pages. With an easy-to-use syntax and a large, extensible library of modules, PHP brings together the best of Perl, C++, and other languages. | PHP Developer s Dictionary Chapter 2. Generating HTML As Web sites become more and more user friendly Web publishers want the content to be more attractive and tailored to the tastes of each user. Visit any of the top-tier Web sites today and each of them will offer some type of customization based on your preferences. This customization might be in the form of personalized weather stock quotes or news. Each of these preferences is read from a database based on your login ID or a cookie value that is passed in from your browser. This section describes some of the methods for generating dynamic content by using PHP. We discuss the use of variables in generating content and how to use the environment dates and times to affect what the user sees. We also discuss sending email from within PHP and using PHP to authenticate to a Web site. Generating Dynamic Content This section defines dynamic content and then discusses practical ways to generate content. The dynamic contents discussed in this section are limited to using request variables and the environment to generate content. Other methods namely using databases to generate content will be discussed in the next chapter. Defining Dynamic Content Let s first define dynamic content. Dynamic content is where the user s Web experience is determined by outside influences. This means that content seen on a site in the morning without intervention from the Webmaster will change in the afternoon and possibly again at night. Using Request Variables to Generate Content PHP can use a number of variables to generate dynamic content. Table describes the environment variables that are available to the PHP script. Table . PHP Variables Variable Description argv argv is defined as an array of arguments passed to the script on the command line. This functionality gives a C-like look and feel to command-line parameters. When the PHP script is called using the get method argv will contain any query string information. argc argc .
đang nạp các trang xem trước