Backed by a tireless development community, PHP has been a model of language evolution over its 10+ year history. Borne from a contract developer’s pet project, these days you’ll find PHP powering many of the world’s largest web sites, including Yahoo!, Digg, EA Games, and Lycos.
PHP Objects, Patterns, and Practice, Second Edition shows you how to meld the power of PHP with the sound enterprise development techniques embraced by professional programmers. Going well beyond the basics of object–oriented development, you’ll learn about advanced topics such as working with static methods and properties, abstract classes, interfaces, design patterns, exception handling, and more. You’ll also be exposed to key tools such as PEAR, CVS, Phing, and phpDocumentor.
What you’ll learn
Write solid, maintainable code by embracing object–oriented techniques and design patterns.
Create detailed, versatile documentation using the powerful phpDocumentor automated documentation system.
Gain new flexibility during the development process by managing your code within a CVS repository and using the Phing build system.
Capitalize upon the quality code of others by using the PEAR package management solution.
Who is this book for?
PHP developers seeking to embrace sound development techniques such as object–orientation, design patterns, testing, and documentation
Related Titles from Apress
Beginning PHP and MySQL: From Novice to Professional, Third Edition
Pro PHP: Patterns, Frameworks, Testing and More
Beginning Google Maps Applications with PHP and Ajax: From Novice to Professional
About this product: In this book you'll learn how to:
Create dynamic websites with design and usability in mind, as well as functionality
Understand how PHP scripts work, giving you confidence to adapt them to your own needs
Bring online forms to life, check required fields, and ensure user input is safe to process
Upload files and automatically create thumbnails from larger images
Manage website content with a searchable database
You want to make your websites more dynamic by adding a feedback form, creating a private area where members can upload images that are automatically resized, or perhaps storing all your content in a database. The problem is, you're not a programmer and the thought of writing code sends a chill up your spine. Or maybe you've dabbled a bit in PHP and MySQL, but you can't get past baby steps. If this describes you, then you've just found the right book. PHP and the MySQL database are deservedly the most popular combination for creating dynamic websites. They're free, easy to use, and provided by many web hosting companies in their standard packages. Unfortunately, most PHP books either expect you to be an expert already or force you to go through endless exercises of little practical value. In contrast, this book gives you real value right away through a series of practical examples that you can incorporate directly into your sites, optimizing performance and adding functionality such as file uploading, email feedback forms, image galleries, content management systems, and much more. Each solution is created with not only functionality in mind, but also visual design. But this book doesn't just provide a collection of ready-made scripts: each PHP Solution builds on what's gone before, teaching you the basics of PHP and database design quickly and painlessly. By the end of the book, you'll have the confidence to start writing your own scripts or—if you prefer to leave that task to othersto adapt existing scripts to your own requirements. Right from the start, you're shown how easy it is to protect your sites by adopting secure coding practices. The book has been written with an eye on forward and backward compatibilityrecommending the latest PHP 5 techniques, but providing alternative solutions for servers still running PHP 4.3. All database examples demonstrate how to use the original MySQL extension, MySQL Improved, or the PHP Data Objects (PDO) introduced in PHP 5.1, letting you choose the most suitable option for your setup. Summary of Contents:
Chapter 1: What Is PHPAnd Why Should I Care?
Chapter 2: Getting Ready to Work with PHP
Chapter 3: How to Write PHP Scripts
Chapter 4: Lightening Your Workload with Includes
Chapter 5: Bringing Forms to Life
Chapter 6: Uploading Files
Chapter 7: Using PHP to Manage Files
Chapter 8: Generating Thumbnail Images
Chapter 9: Pages That Remember: Simple Login and Multipage Forms
Chapter 10: Setting Up MySQL and phpMyAdmin
Chapter 11: Getting Started with a Database
Chapter 12: Creating a Dynamic Online Gallery
Chapter 13: Managing Content
Chapter 14: Solutions to Common PHP/MySQL Problems
Sams Teach Yourself PHP, MySQL® and Apache All in One
Fourth Edition
Julie C. Meloni
Starter Kit
CD-ROM includes a complete starter kit for Windows®, Linux®, and Mac® OS X
In just a short time, you can learn how to use PHP, MySQL, and Apache together to create dynamic, interactive websites and applications using the three leading open-source web development technologies.
Using a straightforward, step-by-step approach, each lesson in this book builds on the previous ones, enabling you to learn the essentials of PHP scripting, MySQL databases, and the Apache web server from the ground up.
Regardless of whether you run Linux, Windows, or Mac OS X, the enclosed CD includes a complete starter kit that lets you install all the software you need to set up a stable environment for learning, testing, and production.
Learn how to…
Install, configure, and set up the PHP scripting language, the MySQL database system, and the Apache Web server
Get these technologies to work together to create a dynamic, database-backed website
Interact with MySQL using PHP
Work with forms and files
Create a web-based discussion forum or mailing list
Add a storefront and shopping cart to your site
Optimize your MySQL databases
Fine-tune the Apache server’s performance
Restrict access to your applications
Set up a secure web server
Julie C. Meloni is the technical director for i2i Interactive, a multimedia company located in Los Altos, California. She has been developing web-based applications since the early days of the web, and is the author of several books and articles on web-based programming languages and database topics, including Sams Teach Yourself MySQL in 24 Hours.
CD-ROM Includes
A complete PHP, MySQL, and Apache starter kit for Windows®, Linux®, or Mac® OS X.
About this product: If you're ready to create web pages more complex than those you can build with HTML and CSS, Head First PHP & MySQL is the ultimate learning guide to building dynamic, database-driven websites using PHP and MySQL. Packed with real-world examples, this book teaches you all the essentials of server-side programming, from the fundamentals of PHP and MySQL coding to advanced topics such as form validation, session IDs, cookies, database queries and joins, file I/O operations, content management, and more.
Head First PHP & MySQL offers the same visually rich format that's turned every title in the Head First series into a bestseller, with plenty of exercises, quizzes, puzzles, and other interactive features to help you retain what you've learned.
Use PHP to transform static HTML pages into dynamic web sites
Create and populate your own MySQL database tables, and work with data stored in files
Perform sophisticated MySQL queries with joins, and refine your results with LIMIT and ORDER BY
Use cookies and sessions to track visitors' login information and personalize the site for users
Protect your data from SQL injection attacks
Use regular expressions to validate information on forms
Dynamically display text based on session info and create images on the fly
Pull syndicated data from other sites using PHP and XML
Throughout the book, you'll build sophisticated examples -- including a mailing list, a job board, and an online dating site -- to help you learn how to harness the power of PHP and MySQL in a variety of contexts. If you're ready to build a truly dynamic website, Head First PHP & MySQL is the ideal way to get going.
About this product: PHP has gained a following among non-technical web designers who need to add interactive aspects to their sites. Offering a gentle learning curve, PHP is an accessible yet powerful language for creating dynamic web pages. As its popularity has grown, PHP's basic feature set has become increasingly more sophisticated. Now PHP 5 boasts advanced features--such as new object-oriented capabilities and support for XML and Web Services--that will please even the most experienced web professionals while still remaining user-friendly enough for those with a lower tolerance for technical jargon.
If you've wanted to try your hand at PHP but haven't known where to start, then "Learning PHP 5" is the book you need. If you've wanted to try your hand at PHP but haven't known where to start, then "Learning PHP 5" is the book you need. With attention to both PHP 4 and the new PHP version 5, it provides everything from a explanation of how PHP works with your web server and web browser to the ins and outs of working with databases and HTML forms. Written by the co-author of the popular "PHP Cookbook," this book is for intelligent (but not necessarily highly-technical) readers. "Learning PHP 5" guides you through every aspect of the language you'll need to master for professional web programming results. This book provides a hands-on learning experience complete with exercises to make sure the lessons stick.
"Learning PHP 5" covers the following topics, and more:
How PHP works with your web browser and web server
PHP language basics, including data, variables, logic and looping
Working with arrays and functions
Making web forms
Working with databases like MySQL
Remembering userswith sessions
Parsing and generating XML
Debugging
Written by David Sklar, coauthor of the "PHP Cookbook" and an instructor in PHP, this book offers the ideal classroom learning experience whether you're in a classroom or on your own. From learning how to install PHP to designing database-backed web applications, "Learning PHP 5" will guide you through every aspect of the language you'll need to master to achieve professional web programming results.
PHP 5 Recipes is a perfect reference manual for PHP. Absolutely everything is covered. You can either... look up information on a certain action, or use the very detailed index to search on a specific function.
— Joe Topjian, Adminspotting
What you hold in your hands is the answer to all your PHP 5 needs. We have written PHP 5 Recipes with a number of purposes in mind.
First, this book is a source of instant solutions, including countless pieces of useful code that you can just copy and paste into your own applications, giving you answers fast and saving you hours of coding time.
Second, this book is a useful reference to the most important aspects of the PHP 5 language, including the vital functions you know and love from previous versions of PHP, as well as the functions introduced in PHP 5.
Finally, this book explains the new PHP 5 functionality in detail, including the vastly improved object-oriented capabilities and the new MySQLi database extension.
We are confident PHP 5 Recipes will be a useful and welcome companion throughout your PHP journey, keeping you on the cutting edge of PHP development, ahead of the competition, and giving you all the answers you need, when you need them.
About this product: Are you ready to begin programming with PHP and MySQL? Then get ready to jump right in. You'll get an introduction to programming with a specific focus on programming web servers with the PHP programming language. Much of the original content from the first edition (1931841322) is retained, but you'll also cover updates relating to the upcoming PHP 5.0 release. Following the same format as the popular first edition, this book provides easy-to-follow instruction. You will use the concepts presented in the book to create games using PHP and MySQL. As each concept is put to the test, you'll acquire programming skills that will easily transition to real-world projects. A true beginner's guide, this book enables you to acquire programming skills that you can use in the next language that you tackle.
About this product: With the surge of popularity of PHP 5, and with PHP 6 just around the corner, Object-Oriented Programming is now an important consideration for PHP developers. This version-neutral book is a gentle introduction to Object-Oriented Programming (OOP) that wont overburden you with complex theory. It teaches you the essential basics of OOP that youll need to know before moving onto a more advanced level, and includes a series of pre-packaged scripts that you can incorporate into your existing sites with the minimum of effort. It shows how OOP can be used to create reusable and portable code by walking you through a series of simple projects. The projects feature the sorts of things developers run up against every day, and include a validator for filtering user input, a simple Date class that avoids the need to remember all the esoteric format codes in PHP, and an XML generator.
Teaches the fundamentals of OOP
Simple projects show how OOP concepts work in the real world
Pre-packaged scripts can easily be added to your own projects
What youll learn
PHP features, such as the Standard PHP Library (SPL), that are poorly documented or ignored by existing books
How to develop classes of their own
OOP in easy-to-understand language without getting bogged down in dense theory
Solid foundations for developers wishing to delve more deeply into OOP
How to leverage the strengths of OOP as a means for creating reusable code that can be used successfully within a procedural context
How to code for both PHP 5 and 6
Who is this book for?
This book is aimed at intermediate-level PHP developers who want to take their skills to the next level by exploring object-oriented programming as a way of creating reusable code for a everyday website tasks. A typical reader would be someone who has read one of the authors previous title, such as PHP Solutions, or one of the PHP books for Dreamweaverand feels ready to tackle something a little more challenging.
About this product: Now installed on more than 20 million Internet domains around the world, PHP is an undisputed leader in web programming languages. Database connectivity, powerful extensions, and rich object-orientation are all reasons for its popularity, but nearly everyone would agree that, above all, PHP is one of the easiest languages to learn and use for developing dynamic web applications. The ease of development and simplicity of PHP, combined with a large community and expansive repository of open source PHP libraries, make it a favorite of web designers and developers worldwide.
"PHP in a Nutshell" is a complete reference to the core of the language as well as the most popular PHP extensions. This book doesn't try to compete with or replace the widely available online documentation. Instead, it is designed to provide depth and breadth that can't be found elsewhere. "PHP in a Nutshell" provides the maximum information density on PHP, without all the fluff and extras that get in the way. The topic grouping, tips, and examples in this book complement the online guide and make this an essential reference for every PHP programmer. This book focuses on the functions commonly used by a majority of developers, so you can look up the information you need quickly. Topics include:
Object-oriented PHP
Networking
String manipulation
Working with files
Database interaction
XML
Multimedia creation
Mathematics
Whether you're just getting started or have years of experience in PHP development, "PHP in a Nutshell" is a valuable addition to your desk library.
About this product: AJAX and PHP: Building Responsive Web Applications is the most practical and efficient resource a reader can get to enter the exciting world of AJAX. This book will teach you how to create faster, lighter, better web applications by using the AJAX ingredients technologies to their full potential. Assuming a basic knowledge of PHP, XML, JavaScript and MySQL, this book will help you understand how the heart of AJAX beats and how the constituent technologies work together. This book is written web developers with a basic knowledge of PHP, XML, JavaScript and MySQL. After teaching the foundations, the book will walk you through numerous real-world case studies covering tasks you’ll be likely to need for your own applications: * Server-enabled form-validation page * Online chat collaboration tool * Customized type-ahead text entry solution * Real-time charting using SVG * Database-enabled, editable and customizable data grid * RSS aggregator application * A server-managed sortable list with drag&drop support using the script.aculo.us JavaScript toolkit
The appendices guide you through installing your working environment, using powerful tools that enable debugging, improving, and profiling your code, working with XSLT and XPath.
Chapter 1: AJAX and The Future Of Web Applications is an initial incursion into the world of AJAX and the vast possibilities it opens up for web developers and companies, to offer a better experience to their users. In this chapter you’ll also build your first AJAX-enabled web page, which will give you a first look of the component technologies.
Chapter 2: Client-Side Techniques with Smarter JavaScript will guide you through the technologies you’ll use to build AJAX web clients, using JavaScript, DOM, the XMLHttpRequest object, and XML. While not being a complete tutorial for these technologies, you’ll be taken to the right track of using them together to build a solid foundation for your future applications.
Chapter 3: Server-Side Techniques with PHP and MySQL completes the theory foundation by presenting how to create smart servers to interact with your AJAX client. You’ll learn various techniques for implementing common tasks, including handling security and error handling problems.
Chapter 4: AJAX Form Validation guides you through creating a responsive, modern form with real-time validation based on server data.
Chapter 5: AJAX Chat presents a simple online chat that works exclusively using AJAX code, without Java applets, Flash code, or other specialized library, as most chat applications work these days.
Chapter 6: AJAX Suggest and Autocomplete builds a Google-suggest like feature, that helps you find PHP functions, and forward you to the official help page for the chosen function.
Chapter 7: SVG (Scalable Vector Graphics) is a text-based graphics language that can be used to draw shapes and text. (SVG is supported natively by Firefox 1.5, and requires a SVG plugin with other browsers). In this case study you learn how to implement a realtime charting solution with AJAX and SVG.
Chapter 8: AJAX Grid teaches you how to build powerful updatable data grid. You’ll learn how to parse XML documents using XSLT to generate the looks of your grid.
Chapter 9: AJAX RSS Reader uses the SimpleXML PHP library, XML and XSLT, to build a simple RSS aggregator.
Chapter 10: AJAX Drag and Drop is a demonstration of using the script.aculo.us framework to build a simple list of elements with drag&drop functionality.
Appendix A: Configuring Your Working Environment teaches you how to install and configure the required software: Apache, PHP, MySQL, phpMyAdmin.