Preface Preface Welcome to PHP! This book has been written to be as comprehensive and as accessible as a book on PHP can be. It puts the power of PHP to work for you, pushing the envelope as far as it can go. The best way to learn any topic like PHP is by example, and this is an exampleoriented book. You ll find dozens of tested examples here, ready to go to work. PHP is quickly gaining popularity these days. Web page authors are requiring more and more power, and PHP is the answer. Not content to simply handle web pages in browsers any more, people are turning to the server side to do things you just can t do in a browser. Using PHP, you have total control over your web applications and the good part is that they re not any harder to write than a typical web page. PHP is an amazing package, and you re getting into it at the right time, when the excitement level is soaring. You ll see more PHP here than in any similar book, doing things you won t see other places, such as drawing images onthefly on the server and then sending them back to the browser. Who Should Read This Book? This book is for you if you truly want to develop all the power of web applications. If you want to start using cookies instead of just having your browser accept them, if you want to handle buttons, text fields, check boxes and more in your web pages, if you want to track users with sessions, or if you want to connect to a database on the server, then look no further. This book lets you take control of the server side of things. In addition, this book is specially written so that you don t need a lot of experience to use it. The only real requirement for this book is familiarity with HTML. You don t need to be an HTML expert, but you ll need to know some. How Is This Book Organized? This book contains nine chapters: Chapter 1 provides a foundation, getting you started with PHP. Chapter 2 is all about using operators and flow control in PHP to begin handling your data. Chapter 3 handles text strings and organizes data into arrays. Chapter 4 introduces functions, which let you wrap up PHP into manageable _sections that can be called by name. Chapter 5 starts using PHP to work with HTML controls such as text fields and buttons in web pages. Chapter 6 shows how to create web applications in more detail by checking what type of browser the user has, how to check the user s data, and more. Chapter 7 introduces objectoriented programming in PHP and shows how to _handle files on the web server. Chapter 8 discusses something that PHP does well: working with databases on the server. In this chapter, we ll work with MySQL. Chapter 9 covers a number of important web techniques: using cookies, sessions, FTP, email, and more. We have included a bonus chapter on the Web site that shows how to draw graphics interactively on the web server and send them back to the browser. To download this chapter, go to [a hrefigual a http://www.awprofessional.com/title/0131498622 targetigual a _blank >http://www.awprofessional.com/title/0131498622 . All you need to read this book is some knowledge of HTML. You don t need to know anything about serverside programming. You get all the material you need right here. As far as software goes, we ll be using PHP 5.0, and I ll show you where to download it for free. All you need to do is to download and install the required software (the installations are easy, unlike some larger software packages). You don t need Internet access to learn PHP from this book. If you want, you can develop and test your PHP pages all on the same computer. However, if you want to put your PHP code on the Internet, you ll need to use an ISP that supports PHP. Check with your ISP to find if they support PHP more and more ISPs are doing so every day. What s Unusual About This Book? This book like other books in the Spring Into... Series includes the following _elements: Each topic is explained in a discrete one or twopage unit called a chunk. Each chunk builds on the previous chunks in that chapter. Most chunks contain one or more examples. I believe that good examples provide the foundation for almost all useful technical documents. Many chunks contain sidebars that provide helpful, ancillary material. In addition, this book is filled with examples dozens of them because seeing a working example is the best way to learn this material. Here are just a few included topics: Reading data from a web page s text fields, radio buttons, check boxes, and list boxes on the server Creating and handling image maps Tracking users with sessions and cookies Writing data to files on the server (such as guest books) Recovering from errors without crashing Connecting to databases on the server Using SQL to work with databases Drawing images onthefly and sending them back to the browser Handling strings and arrays Working with the PHP operators Creating functions Creating classes and objects Using FTP from PHP Sending email from PHP Using sessions to preserve data between page accesses The complete PHP syntax There s a lot to PHP, and there s a lot to this book. Our plan is to cram as much PHP into the book as we can. Where Can You Download Examples Used in This Book? The code in this book is available for download at http://www.awprofessional.com/springinto . All the code examples have been tested by the author and tech editor on different machines. This book is designed to be at the top of the PHP field. If you have comments and suggestions for improvements, please write to me, care of Prentice Hall. This book is _designed to be the new standard in PHP programming books, more complete and more accessible than ever before. Please keep in touch with ways to improve it and keep it on _the cutting edge. Thanks. Who Helped Me Write This Book? A book like this is the work of many people. Besides your local author, Mark L. Taub and Barry Rosenberg helped create and design the book. Matt Wade and Eugenia Harris did excellent reviews of the manuscript. That s it. We re ready to dig into PHP on Chapter 1. Copyright Pearson Education. All rights reserved.
Es doctor en ciencias, fue editor de la revista PC Magazine y ha trabajado en el MIT y en la Universidad de Cornell. Además de este libro, también es autor de las obras Physics II For Dummies, Physics Essentials For Dummies y Quantum Physics For Dummies.