1. Trang chủ
  2. » Công Nghệ Thông Tin

Web Database Applications with PHP and MySQL Oreilly

833 41 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 833
Dung lượng 6,29 MB

Nội dung

Một cơ sở dữ liệu Web là một ứng dụng cơ sở dữ liệu được thiết kế để quản lý và truy cập thông qua Internet. Người điều hành trang web có thể quản lý bộ sưu tập dữ liệu này và trình bày kết quả phân tích dựa trên dữ liệu trong ứng dụng cơ sở dữ liệu Web.

This document was created by an unregistered ChmMagic, please go to http://www.bisenter.com to register it T only for RuBoard - not distribute or recompile Copyright Table of Contents Index Full Description Reviews Reader reviews Errata Web Database Applications with PHP & MySQL Hugh E Williams David Lane Publisher: O'Reilly First Edition March 2002 ISBN: 0-596-00041-3, 582 pages Web Database Applications with PHP and MySQL offers web developers a mixture of theoretical and practical information on creating web database applications Using PHP and MySQL, two open source technologies that are often combined to develop web applications, the book offers detailed information on designing relational databases and on web application architecture, both of which will be useful to readers who have never dealt with these issues before The book also introduces Hugh and Dave's Online Wine Store, a complete (but fictional) online retail site implemented using PHP and MySQL only for RuBoard - not distribute or recompile This document was created by an unregistered ChmMagic, please go to http://www.bisenter.com to register it Thanks only for RuBoard - not distribute or recompile Web Database Applications with PHP & MySQL Preface What This Book Is About What You Need to Know How This Book Is Organized How to Use This Book Conventions Used in This Book How to Contact Us Web Site and Code Examples Acknowledgments Database Applications and the Web 1.1 Three-Tier Architectures 1.2 The Client Tier 1.3 The Middle Tier 1.4 The Database Tier 1.5 Our Case Study PHP 2.1 Introducing PHP 2.2 Conditions and Branches 2.3 Loops 2.4 A Working Example 2.5 Arrays 2.6 Strings 2.7 Regular Expressions 2.8 Date and Time Functions 2.9 Integer and Float Functions 2.10 User-Defined Functions 2.11 Objects This document was created by an unregistered ChmMagic, please go to http://www.bisenter.com to register it Thanks 2.12 Common Mistakes MySQL and SQL 3.1 Database Basics 3.2 Quick Start Guide 3.3 MySQL Command Interpreter 3.4 Managing Databases, Tables, and Indexes 3.5 Inserting, Updating, and Deleting Data 3.6 Querying with SQL SELECT 3.7 Join Queries 3.8 Modifying the Database 3.9 Functions 3.10 More on SQL and MySQL Querying Web Databases 4.1 Connecting to a MySQL Database 4.2 Formatting Results 4.3 Case Study: The Front-Page Panel 4.4 Interacting with Other DBMSs Using PHP User-Driven Querying 5.1 User Input 5.2 Querying with User Input 5.3 Case Study: Previous and Next Browsing 5.4 Case Study: Producing a select List Writing to Web Databases 6.1 Database Inserts, Updates, and Deletes 6.2 Issues in Writing Data to Databases Validation on the Server and Client 7.1 Validation and Error Reporting for Web Database Applications 7.2 Server-Side Validation 7.3 Client-Side Validation with JavaScript Sessions 8.1 Building Applications That Keep State 8.2 Session Management Over the Web 8.3 PHP Session Management 8.4 Case Study: Adding Sessions to the Winestore 8.5 When to Use Sessions Authentication and Security 9.1 HTTP Authentication 9.2 HTTP Authentication with PHP 9.3 Authentication Using a Database This document was created by an unregistered ChmMagic, please go to http://www.bisenter.com to register it Thanks 9.4 Web Database Applications and Authentication 9.5 Protecting Data on the Web 10 Winestore Customer Management 10.1 Overview of the Winestore Application 10.2 Customer Management 10.3 Authenticating Users 10.4 The Winestore Include Files 11 The Winestore Shopping Cart 11.1 The Winestore Home Page 11.2 The Shopping Cart Architecture 11.3 Managing Redirection 12 Ordering and Shipping at the Winestore 12.1 Finalizing Orders 12.2 HTML and Email Receipts 13 Related Topics 13.1 Automated Housekeeping 13.2 Templates 13.3 Searching and Browsing A Installation Guide A.1 Installing MySQL, Apache, and PHP A.2 Installing the Winestore Examples A.3 Installing Apache to Use SSL A.4 Installation Resources B Internet and Web Protocols B.1 The Internet B.2 Hypertext Transfer Protocol C Modeling and Designing Relational Databases C.1 The Relational Model C.2 Entity-Relationship Modeling D Managing Sessions in the Database Tier D.1 Using a Database to Keep State D.2 PHP Session Management D.3 MySQL Session Store E Resources E.1 Client Tier Resources E.2 Middle Tier Resources E.3 Database Tier Resources This document was created by an unregistered ChmMagic, please go to http://www.bisenter.com to register it Thanks E.4 Security and Cryptography Resources Colophon only for RuBoard - not distribute or recompile This document was created by an unregistered ChmMagic, please go to http://www.bisenter.com to register it Thanks only for RuBoard - not distribute or recompile Web Database Applications with PHP & MySQL Copyright © 2002 O'Reilly & Associates, Inc All rights reserved Printed in the United States of America Published by O'Reilly & Associates, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472 O'Reilly & Associates books may be purchased for educational, business, or sales promotional use Online editions are also available for most titles (http://safari.oreilly.com) For more information contact our corporate/institutional sales department: 800-998-9938 or corporate@oreilly.com The O'Reilly logo is a registered trademark of O'Reilly & Associates, Inc Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks Where those designations appear in this book, and O'Reilly & Associates, Inc was aware of a trademark claim, the designations have been printed in caps or initial caps The association between the image of a platypus and the topic of web database applications with PHP and MySQL is a trademark of O'Reilly & Associates, Inc While every precaution has been taken in the preparation of this book, the publisher and the author assume no responsibility for errors or omissions, or for damages resulting from the use of the information contained herein This document was created by an unregistered ChmMagic, please go to http://www.bisenter.com to register it T only for RuBoard - not distribute or recompile This document was created by an unregistered ChmMagic, please go to http://www.bisenter.com to register it T only for RuBoard - not distribute or recompile Preface Web database applications integrate databases and the Web Well-known web destinations such as online auction sites, retail stores, news sites, discussion forums, and personalized home pages are all examples of web database applications The popularity of these applications stems from their accessibility and usability: thousands of users can access the same data at the same time without the need to install additional software on their machines only for RuBoard - not distribute or recompile This document was created by an unregistered ChmMagic, please go to http://www.bisenter.com to registe only for RuBoard - not distribute or recompile What This Book Is About This book is for developers who want to build database applications that are integrated with the Web It presents the principles and techniques of developing small- to medium-scale web database applications that store, manage, and retrieve data, as well as the basic techniques for securing an application The architecture we describe is a successful framework for applications that can run on modest hardware and process more than a million hits per day from users An important feature of this book is our ongoing case study, Hugh and Dave's Online Wines It's a complete but fictional online retail store that allows users to browse and search a database of wines, add items to a shopping cart, manage their membership, and purchase wines Searching, browsing, storing user data, validating user input, managing user transactions, and security are each the subject of a chapter, and each topic is illustrated with examples from the case study The completed winestore scripts are presented and briefly discussed at the end of the book We use open source software Our database management system (DBMS) is MySQL, a system known for its suitability to applications that require speed but low resource overheads Our scripting language is PHP, which is best known for its function libraries that interact with more than 15 relational database systems, the web environment, and many other services We use PHP to develop the application logic that brings together the Web and the relational database management system (RDBMS) Apache is our web server of choice only for RuBoard - not distribute or recompile This document was created by an unregistered ChmMagic, please go to http://www.bisenter.com to register it Thanks only for RuBoard - not distribute or recompile What You Need to Know This book is about understanding and developing application logic that brings databases and the Web together We introduce database systems over the course of the book, but our discussions don't replace a book or class dedicated to relational database theory, or a book about a specific relational database system such as MySQL Likewise, we assume you are already familiar with the Web We introduce but don't delve deeply into the three key web protocols, HTML, HTTP, and TCP/IP We also assume you can program in a third-generation programming language such as C, C++, Java, Perl, FORTRAN, or Visual Basic Our introduction to the PHP web scripting language doesn't assume you are familiar with web scripting or are an expert programmer, but we assume you understand the basic HTML constructs and are familiar with the popular web browsers If you can author an HTML document with a text editor that contains a and a element, you have sufficient HTML skills to use this book It is the principles of structure in the markup process that are important, not the attractiveness or usability of the presentation in the web browser We introduce advanced HTML concepts as required, but an HTML guide such as O'Reilly's HTML and XHTML: The Definitive Guide, by Chuck Musciano and William Kennedy, is a useful resource for understanding and building web database applications You may also find O'Reilly's Programming PHP, by Rasmus Lerdorf and Kevin Tatroe useful as well You don't need a detailed understanding of relational databases to use this book, but a working knowledge is helpful We present the relational database theory needed for developing simple applications, and we cover many other basic concepts, including how to tell when a database is the method of choice to store data, the architecture of a DBMS, the database query language SQL, and a case study that models system requirements and converts the model to a database design This book isn't a substitute for the many good resources on database theory, however, it's enough to begin developing the underlying databases for many web database applications We briefly introduce web servers and networking in Chapter and provide additional material in Appendix B Both web servers and networking are important to a web database application but aren't the focus of this book We present enough information to set up a web server and to understand how it fits in the architecture of a web database application For many applications, this is sufficient Likewise, we present sufficient detail so that you will understand what networking and network protocol issues impact web database ... developers who want to build database applications that are integrated with the Web It presents the principles and techniques of developing small- to medium-scale web database applications that store,... book Chapter to Chapter introduce web database applications, PHP, MySQL, and SQL: Chapter Discusses the three-tier architecture commonly used in web database applications and in those that we... use with web servers and web protocols This book is about bringing together the Web and databases Most web database applications this through three layers of application logic At the base is a database

Ngày đăng: 09/03/2021, 16:18

TỪ KHÓA LIÊN QUAN