Tải bản đầy đủ (.pdf) (5 trang)

PHP and MySQL Web Development - P9 pps

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (63.4 KB, 5 trang )

7
Introduction
Part II,“Using MySQL,” discusses the concepts and design involved in using relational
database systems such as MySQL, using SQL, connecting your MySQL database to the
world with PHP, and advanced MySQL topics, such as security and optimization.
Part III,“E-commerce and Security,” covers some of the general issues involved in
developing an e-commerce site using any language.The most important of these issues is
security.We then discuss how you can use PHP and MySQL to authenticate your users
and securely gather, transmit, and store data.
Part IV, “Advanced PHP Techniques,” offers detailed coverage of some of the major
built-in functions in PHP.We have selected groups of functions that are likely to be use-
ful when building an e-commerce site.You will learn about interaction with the server,
interaction with the network, image generation, date and time manipulation, and session
variables.
Part V, “Building Practical PHP and MySQL Projects,” deals with practical real-world
issues such as managing large projects and debugging, and provides sample projects that
demonstrate the power and versatility of PHP and MySQL.
Finally
We hope you enjoy this book, and enjoy learning about PHP and MySQL as much as
we did when we first began using these products.They are really a pleasure to use. Soon,
you’ll be able to join the thousands of Web developers who use these robust, powerful
tools to easily build dynamic, real-time Web sites.
01 525x intro 1/24/03 3:39 PM Page 7
01 525x intro 1/24/03 3:39 PM Page 8
I
Using PHP
1 PHP Crash Course
2 Storing and Retrieving Data
3 Using Arrays
4 String Manipulation and Regular Expressions
5 Reusing Code and Writing Functions


6 Object-Oriented PHP
02 525x part1 1/24/03 2:56 PM Page 9
02 525x part1 1/24/03 2:56 PM Page 10
1
PHP Crash Course
THIS CHAPTER GIVES YOU A QUICK
overview of PHP syntax and language constructs. If
you are already a PHP programmer, it might fill some gaps in your knowledge. If you
have a background using C,ASP, or another programming language, it will help you get
up to speed quickly.
In this book, you’ll learn how to use PHP by working through lots of real world
examples, taken from our experience in building e-commerce sites. Often programming
textbooks teach basic syntax with very simple examples.We have chosen not to do that.
We r ecognize that often what you want to do is get something up and running, to
understand how the language is used, rather than plowing through yet another syntax
and function reference that’s no better than the online manual.
Tr y the examples out—type them in or load them from the CD-ROM, change
them, break them, and learn how to fix them again.
In this chapter, we’ll begin with the example of an online product order form to
learn how variables, operators, and expressions are used in PHP.We will also cover vari-
able types and operator precedence.You will learn how to access form variables and how
to manipulate them by working out the total and tax on a customer order.
We will then develop the online order form example by using our PHP script to val-
idate the input data.We’ll examine the concept of Boolean values and give examples of
using
if, else,the ?: operator, and the switch statement.
Finally, we’ll explore looping by writing some PHP to generate repetitive HTML
tables.
Key topics you will learn in this chapter include
n

Embedding PHP in HTML
n
Adding dynamic content
n
Accessing form variables
n
Identifiers
n
User declared variables
n
Va r iable types
03 525x ch01 1/24/03 3:40 PM Page 11

×