Đang chuẩn bị liên kết để tải về tài liệu:
PHP and MySQL Web Development - P157
Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
PHP and MySQL Web Development - P157: 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. | 752 Chapter 31 Connecting to Web Services with XML and SOAP Table 31.1 Continued Filename Product.php Type Class file Description Contains the PHP class that stores information on one particular book bookdisplayfunctions .php Functions Contains functions that help display a book and lists of books cachefunctions.php Functions Contains functions to carry out the caching required by Amazon cartfunctions.php Functions Contains shopping cart related functions categoryfunctions.php Functions Contains functions that help retrieve and display a category utilityfunctions.php Functions Contains a set of utility functions used throughout the application You will also need the nusoap.php file we mentioned previously as it is required in these files. NuSOAP is in the chapter31 directory on the CD-ROM at the back of the book but you might like to replace it with a newer version from http dietrich.ganx4.com nusoap index.php. We will begin by looking at the core application file index.php. Core Application The application file index.php is shown in Listing 31.3. Listing 31.3 index.php The Core Application File php we are only using one session variable cart to store the cart contents session_start require_once constants.php require_once utilityfunctions.php require_once bookdisplayfunctions.php require_once cartfunctions.php require_once categoryfunctions.php These are the variables we are expecting from outside. They will be validated and converted to globals external array action ASIN mode browseNode page search the variables may come via Get or Post convert all our expected external variables to short global names foreach external as e Solution Overview 753 Listing 31.3 Continued if @ HTTP_POST_VARS e e HTTP_POST_VARS e else if @ HTTP_GET_VARS e e HTTP_GET_VARS e else e e trim e default values for global variables if mode mode books No other modes have been tested if browseNode browseNode 1000 1000 is bestselling books if page page 1 First Page - there are 10 items per page .