tailieunhanh - PHP and MySQL Web Development - P89

PHP and MySQL Web Development - P89: PHP and MySQL Web Development teaches the reader to develop dynamic, secure, commercial Web sites. Using the same accessible, popular teaching style of the first edition, this best-selling book has been updated to reflect the rapidly changing landscape of MySQL and PHP. | 412 Chapter 19 Generating Images You can use a similar approach to draw line graphs and even pie charts if you are good at mathematics. Other Image Functions In addition to the image functions we have used in this chapter there are functions to let you draw curved lines ImageArc and polygons ImagePolygon as well as variations on the ones we have used here. Always begin by sketching what you want to draw and then you can hit the manual for any extra functions you might need. Further Reading A lot of reading material is available online. If you re having trouble with the image functions it sometimes helps to look at the source documentation for gd because the PHP functions are wrappers for this library. The gd documentation is available at http gd There are also some excellent tutorials on particular types of graph applications particularly at Zend and Devshed http http The bar chart application in this chapter was inspired by the dynamic bar graph script written by Steve Maranda available from Devshed. Next In the next chapter we ll tackle PHP s handy session control functionality new in PHP 4. 20 Using Session Control in PHP THIS CHAPTER WILL DISCUSS THE SESSION control functionality in PHP 4. We will cover What session control is Cookies Setting up a session Session variables Sessions and authentication What Session Control Is You might have heard it said that HTTP is a stateless protocol. What this means is that the protocol has no built-in way of maintaining state between two transactions. When a user requests one page followed by another HTTP does not provide a way for us to tell that both requests came from the same user. The idea of session control is to be able to track a user during a single session on a Web site. If we can do this we can easily support logging in a user and showing content according to her authorization level or personal preferences. We can track the user s behavior. We can implement shopping carts.

TỪ KHÓA LIÊN QUAN